Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

This script stopt working after i publish game any help ?

Asked by 6 years ago

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)


0
is the script a local script? hellmatic 1523 — 6y
0
no, just a normal script on a part in workspace. silverman159753 0 — 6y
0
What errors are you getting? When you publish, the character rig switches from R6 to R15. Meltdown81 309 — 6y
0
i dont get any error anymore, its like the script just breaks. But i have to say the test only worked whit the r6 models in studio silverman159753 0 — 6y
0
@Meltdown : Thanks for pointing out the r6 to r15 models ,i just chanched ("Torso") to ("UpperTorso") and now it works fine :) silverman159753 0 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

Your most likely in experimental mode.

0
FilterEnable is true but when i turn it off its just the same silverman159753 0 — 6y
Ad

Answer this question