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

Detecting changes on instances that have not yet spawned?

How would I go on and detect changes in an instance such as an IntValue on the server which has yet not been spawned.

Basically I store my players Stamina in an IntValue which is located in ServerStorage but the amount of IntValue's always change due to players leaving and joining. So how would I detect a change in that from another script on the server that was there since the server started.

I was planning on putting a script in the intvalue when I spawn it in as the player joins the game which detects changes and then evokes a bindable event which can be then used by my other script.

2 answers

You could probably try putting this in a server script or something

IntValue:GetPropertyChangedSignal("Value"):connect(function()
BindableEvent:Fire() --put arguments here if required
-- can put more code here before the 'end)'
end)

Let me just say that what your asking is very unclear and this is what I assume ur asking for.

local folder = game.ServerStorage:WaitForChild("FolderofIntvalues")
folder.ChildAdded:Connect(function(Intval)
	Intval.Changed:Connect(function(newval)
		print('look at the end of code')
	end)
end)
print('let me put a big fat watermark')
--made by tim i bet you'll delete

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