Ok so i am making a shop. Everything is fine. I am using magnitude for the shop to open. The magnitude is scripted in a localscript inside a gui where the shop comes up.
But when two people play the game, the magnitude stops working and gets buggy and stuff.
I cant solve this problem myself so i figured to ask you guys.
Here is the script:
repeat wait() until game.Players.LocalPlayer.Character
while wait() do
for i, v in pairs(game.Players:GetChildren()) do
if (v.Character.Head.Position - detection.Position).magnitude <= 10 then
game.Players.LocalPlayer.PlayerGui.Shop.TextButton.Visible = true
else
game.Players.LocalPlayer.PlayerGui.Shop.TextButton.Visible = false
camera.CameraType = Enum.CameraType.Custom
end
end
end
btw when you walk out from the magnitude the camera resets.
