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

How would you detect if a variable has update?

I am trying to make a boat that uses remote events to communicate with the server script. When I tried this:

local seat = nil
seat.Changed:connect(function()

	MoveEvent = seat.RemoteEvent
end)

it gave this error: 10:00:02.427 - Players.Player.PlayerScripts.LocalScript:37: attempt to index local 'seat' (a nil value) notes: I can't just define a variable for that seat. I need it to work with any boat

1 comment

0

You need to provide a little more information. You mention Remote events but I do not see any remote events present in your script.

1 answer

If you mean you want this variable accessible from all serverscripts, then you must assign a global variable. So you would do this: _G.seat = nil

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