Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How would i run this function when a string is changed?

Asked by
Altives 17
3 years ago

I've had this thing for about 2 days now and i was wondering is it possible? The code is on a pastebin here https://pastebin.com/DtepNEtA

I'm curious if it's possible or not Any Help would be appreciated!

0
Its a PrivratePase :/ CrazyCats84 154 — 3y
0
The paste you just shared is private. nievadev 112 — 3y
0
done it's public now Altives 17 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

Hi, the one suggestion I can think of is a StringValue object and then using the .Changed Event as you can see here StringValue which both shows what a string value is and explaining how .Changed works at the very bottom


local table = { "yes", "no", "lol" } local ValueChosen = Instance.new('StringValue') ValueChosen.Value = 'hi' ValueChosen.Changed:Connect(hi) when changed is fired for Value objects it fires what the value is changed to function hi(newvalue) --newvalue in case the value chosen has an actual effect on what you want the code to do print('hi') end --This will obviously work but i want to run the 'hi' function only when the 'valueChosen' is changed and run it again when 'valueChosen' is changed again --I'm not sure if it's possible which is why I'm asking for help here --hope my changes answer the questions you have here^

I hope this helps feel free to comment if you have any further questions

0
works thanks for letting me know this! Altives 17 — 3y
0
thats good Natsudragneel2500 80 — 3y
Ad

Answer this question