Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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!

3 comments

0

Its a PrivratePase :/

0

The paste you just shared is private.

0

done it's public now

1 answer

✓ Accepted answer

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

2 comments

0

works thanks for letting me know this!

0

thats good

This discussion is preserved as it was. New answers, comments, and votes are closed.