hi all
so this script works when i test my server in studio, but once i publish game the script stopt working in game and in studio :( any help ?
thx
function onClicked(Player) local torso = Player.Character:findFirstChild("Torso") if torso ~= nil then local playertest = Player.Character:findFirstChild("Humanoid") if playertest ~= nil then if playertest.Health > 0 then local stats = Player:findFirstChild("leaderstats") if stats ~= nil then local cash = stats:findFirstChild("Floor") if cash.Value >= 1 then variable local location = game.Workspace.floor1.Position local x = location["X"] local y = location["Y"] local z = location["Z"] in the new position x = x + math.random(-5, 5) y = y + 3 z = z + math.random(-5, 5) local cf = torso.CFrame torso.CFrame = CFrame.new(Vector3.new(x,y,z)) end end end end end end script.Parent.ClickDetector.MouseClick:connect(onClicked)
Your most likely in experimental mode.