So I have this zone, on which people can enter only if they have a certain amount of a value. However while testing with another player, I noticed that the entrance to the zone relies on everybody and not only the client.
The code is in a local script:
local player = game.Players.LocalPlayer
local Data2 = player:WaitForChild("Data2")
local Bought = Data2:WaitForChild("MultiplierBought")
if Bought.Value >=5 then
script.Parent.Color = Color3.new(0.27451, 0.611765, 0)
script.Parent.CanCollide = false
else
script.Parent.Color = Color3.new(1, 0, 0.0156863)
script.Parent.CanCollide = true
end
Bought.Changed:Connect(function(value)
if value >=5 then
script.Parent.Color = Color3.new(0.27451, 0.611765, 0)
script.Parent.CanCollide = false
else
script.Parent.Color = Color3.new(1, 0, 0.0156863)
script.Parent.CanCollide = true
end
end)
To sum it all up, I just want the part to change properties once the client has obtained the right value. I don’t want the part to rely on everyone.