✓ Accepted answer
This is hard to debug for me because you have gave little information about the problem, okay it is not working, are there any errors in the output? If yes then post them everytime when making question because this is how you should debug your code.
My answer won't be accurate but i assume that
local value = part.Parent.NextMove.Value
Here, NextMove is BoolValue Instance inside of some parent and .Value is it's value, which is boolean, if it is true then you've got an error which says: Attempt to index boolean with Changed. The reason why this is happening because value variable stands for NextMove's value which is true or false and Changed cannot be called on script values (Script values are those that can't be seen in workspace, by that i mean all values inside of a script like: v = 5, v = true, v = "string", these are script values). Changed is event of all instances so what you should do is set the variable to the BoolValue instance
local value = part.Parent.NextMove
and call changed on it
value.Changed:Connect(function()
end)
But this won't work if local value = part.Parent.NextMove.Value is an instance and not value
1 comment
I'm sure it's due to plr, you weren't still touching the part so the plr is still nil, make sure to wait until the part gets touched. Could be done using 'part.Touched:Wait()'