Author Topic:  Scripts not working correctly  (Read 858 times)

0 Members and 1 Guest are viewing this topic.

Im Alliance

  • Fresh Meat
  • *
  • Posts: 6
    • View Profile
    • Awards
  • Xbox: Im Alliance
Scripts not working correctly
« on: April 09, 2017, 11:12:05 PM »
I have some VIP scripts on my world, they're exactly like the 6 ones before it and have no mistakes but they don't function right? Why?

TheDestinedCrab

  • Legendary Member
  • *****
  • Posts: 1272
  • Did you see that? Me neither.
  • Awards 3 years on site+600 posts Donated a giveaway prize. (Must be a prize of cash value.) 2 years on site+300 posts 1 year on site+100 posts
    • View Profile
    • Awards
Re: Scripts not working correctly
« Reply #1 on: April 10, 2017, 03:32:05 AM »
Could you please tell us the scripts that you're using?

Also, you might be looking for a script like this so make sure that it matches up to yours :)

Spoiler for script:

Script to check if they have VIP.

If
HasHistory [player] [VIP] [true] //Checks to see if they have VIP
Then
Teleport [x,y,z]
//You could put anything here like remove the two blocks next to the script block or something but I just kept it simple for now :)
Else
Messagebox [You don't own VIP [gamertag], would you like to get it?] [A= Yes![GetVIP]] [B= No.[Exit]] //Gives them a message to ask if they'd like to buy VIP.

Script to give them VIP

If
HasHistory [player] [VIP] [true]
Then
Messagebox [You already have VIP!]
Elseif
HasInventory [player] [goldpieces] [>=] [50000] //If they have 50K GP
Then
Inventory [player] [take] [goldpieces] [50000]
History [player] [VIP] [+1] //Take the GP and give them VIP.

Script Exit.

Exit //This command exits the script.


Hope this helped,
TheDestinedCrab.
Thanks Gold Knight for the amazing sig!

Im Alliance

  • Fresh Meat
  • *
  • Posts: 6
    • View Profile
    • Awards
  • Xbox: Im Alliance
Re: Scripts not working correctly
« Reply #2 on: April 11, 2017, 02:00:02 AM »
If
HasHistory [C1] [player] [false]
Then
MessageBox [you need the previous rank.]
ElseIf
HasHistory [C2] [player] [true]
Then
MessageBox [you already have this rank do you want to but the next one?]
ElseIf
HasInventory [player] [gold pieces] [>=] [1250000]
Then
Inventory [player] [take] [gold pieces] [1250000]
Notify [[gamertag] now has C-2!] [global] [0,0,100]
History [C2] [player]
Else
MessageBox [insufficent funds]

For some reason it takes the gold but doesn't give the player the history, also when players that have bought this rank already leave and join back another day they don't have it anymore.

.ok

  • Supreme Member
  • *****
  • Posts: 2203
  • Awards Site art contributions/TPs in-game/Contest winners 4 years on site+1000 posts Members who have unlocked the robotic avatar Donated a giveaway prize. (Must be a prize of cash value.) 3 years on site+600 posts 2 years on site+300 posts Week 1 members w/25+ posts (4/13/13-4/20/13) 1 year on site+100 posts
    • View Profile
    • Awards
Re: Scripts not working correctly
« Reply #3 on: April 11, 2017, 12:01:49 PM »
Try this




Im Alliance

  • Fresh Meat
  • *
  • Posts: 6
    • View Profile
    • Awards
  • Xbox: Im Alliance
Re: Scripts not working correctly
« Reply #4 on: April 11, 2017, 02:52:06 PM »
I know I can always change it but I was just wondering why it doesnt work

Hayden

  • Elite Member
  • *****
  • Posts: 509
  • Obey no one, Respect everyone.
  • Awards 1 year on site+100 posts Donated a giveaway prize. (Must be a prize of cash value.) 2 years on site+300 posts
    • View Profile
    • Awards
  • Xbox: mister m0nk3y
  • Steam: Hayden
  • Other: 123456789
Re: Scripts not working correctly
« Reply #5 on: April 11, 2017, 03:18:54 PM »
MessageBox [you need the previous rank.]
change MessageBox [you need the previous rank.]
to MessageBox [[you need the previous rank.]]
and MessageBox [you already have this rank do you want to but the next one?]
to MessageBox [[you already have this rank do you want to but the next one?]]
and MessageBox [insufficent funds]
to MessageBox [[insufficient funds]]
Max characters: 300; characters remaining: 241

TheDestinedCrab

  • Legendary Member
  • *****
  • Posts: 1272
  • Did you see that? Me neither.
  • Awards 3 years on site+600 posts Donated a giveaway prize. (Must be a prize of cash value.) 2 years on site+300 posts 1 year on site+100 posts
    • View Profile
    • Awards
Re: Scripts not working correctly
« Reply #6 on: April 11, 2017, 04:39:31 PM »
MessageBox [you need the previous rank.]
change MessageBox [you need the previous rank.]
to MessageBox [[you need the previous rank.]]
and MessageBox [you already have this rank do you want to but the next one?]
to MessageBox [[you already have this rank do you want to but the next one?]]
and MessageBox [insufficent funds]
to MessageBox [[insufficient funds]]

Incorrect. You don't need the double brackets for any of them.
Also, that should be corrected to:

MessageBox [you already have this rank do you want to but the next one?] [a=[Yes please.][Script]] [b=[No thanks.][Script]]
Thanks Gold Knight for the amazing sig!

Hayden

  • Elite Member
  • *****
  • Posts: 509
  • Obey no one, Respect everyone.
  • Awards 1 year on site+100 posts Donated a giveaway prize. (Must be a prize of cash value.) 2 years on site+300 posts
    • View Profile
    • Awards
  • Xbox: mister m0nk3y
  • Steam: Hayden
  • Other: 123456789
Re: Scripts not working correctly
« Reply #7 on: April 11, 2017, 08:05:47 PM »
MessageBox [you need the previous rank.]
change MessageBox [you need the previous rank.]
to MessageBox [[you need the previous rank.]]
and MessageBox [you already have this rank do you want to but the next one?]
to MessageBox [[you already have this rank do you want to but the next one?]]
and MessageBox [insufficent funds]
to MessageBox [[insufficient funds]]

Incorrect. You don't need the double brackets for any of them.
Also, that should be corrected to:

MessageBox [you already have this rank do you want to but the next one?] [a=[Yes please.][Script]] [b=[No thanks.][Script]]
First of all, I checked script docs, you are correct on the first part, and second of all there is no need for there to be options, third of all [b=[text[script]] would not do anything because you have no access to the letter B, It is always automatically Exit unless you do [nocancel] then the letter A becomes the exit button
Max characters: 300; characters remaining: 241

Hayden

  • Elite Member
  • *****
  • Posts: 509
  • Obey no one, Respect everyone.
  • Awards 1 year on site+100 posts Donated a giveaway prize. (Must be a prize of cash value.) 2 years on site+300 posts
    • View Profile
    • Awards
  • Xbox: mister m0nk3y
  • Steam: Hayden
  • Other: 123456789
Re: Scripts not working correctly
« Reply #8 on: April 11, 2017, 08:14:41 PM »
I have some VIP scripts on my world, they're exactly like the 6 ones before it and have no mistakes but they don't function right? Why?
So, how does it function incorrectly? What is the result/outcome of running the script, and what should it be omitting?
Max characters: 300; characters remaining: 241

Im Alliance

  • Fresh Meat
  • *
  • Posts: 6
    • View Profile
    • Awards
  • Xbox: Im Alliance
Re: Scripts not working correctly
« Reply #9 on: April 11, 2017, 11:13:00 PM »
It takes the gold but doesn't add history

Hayden

  • Elite Member
  • *****
  • Posts: 509
  • Obey no one, Respect everyone.
  • Awards 1 year on site+100 posts Donated a giveaway prize. (Must be a prize of cash value.) 2 years on site+300 posts
    • View Profile
    • Awards
  • Xbox: mister m0nk3y
  • Steam: Hayden
  • Other: 123456789
Re: Scripts not working correctly
« Reply #10 on: April 11, 2017, 11:46:51 PM »
Strange, it should work perfectly fine like that... Try this instead though
History [C2] [player] [1]
If that dosen't work try

History [C2] [player] [+1]


It may be a bug, because that should work... But I want you to try this and tell me the result...
Max characters: 300; characters remaining: 241

TheDestinedCrab

  • Legendary Member
  • *****
  • Posts: 1272
  • Did you see that? Me neither.
  • Awards 3 years on site+600 posts Donated a giveaway prize. (Must be a prize of cash value.) 2 years on site+300 posts 1 year on site+100 posts
    • View Profile
    • Awards
Re: Scripts not working correctly
« Reply #11 on: April 12, 2017, 03:53:04 AM »
As Hayden said, you missed off the +1. I'd also try putting it before the notify command as I find that to work a little smoother.
Thanks Gold Knight for the amazing sig!

Hayden

  • Elite Member
  • *****
  • Posts: 509
  • Obey no one, Respect everyone.
  • Awards 1 year on site+100 posts Donated a giveaway prize. (Must be a prize of cash value.) 2 years on site+300 posts
    • View Profile
    • Awards
  • Xbox: mister m0nk3y
  • Steam: Hayden
  • Other: 123456789
Re: Scripts not working correctly
« Reply #12 on: April 12, 2017, 04:55:36 PM »
As Hayden said, you missed off the +1. I'd also try putting it before the notify command as I find that to work a little smoother.
They didn't miss it, It should work the way they have it... Its just there may be a bug and that's why it's not working....
Max characters: 300; characters remaining: 241

.ok

  • Supreme Member
  • *****
  • Posts: 2203
  • Awards Site art contributions/TPs in-game/Contest winners 4 years on site+1000 posts Members who have unlocked the robotic avatar Donated a giveaway prize. (Must be a prize of cash value.) 3 years on site+600 posts 2 years on site+300 posts Week 1 members w/25+ posts (4/13/13-4/20/13) 1 year on site+100 posts
    • View Profile
    • Awards
Re: Scripts not working correctly
« Reply #13 on: April 13, 2017, 01:09:25 AM »
try doing each rank sepperate and when it removes the gold from their inventory add the right history
also dont forget to either make each history sepperate or make sure if you just add onto the existing history make it [+1] and not a single number being it would just make the history that number

otherwise do each vip or history sepperate