Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

This script stopt working after i publish game any help ?

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)


5 comments

0

is the script a local script?

0

no, just a normal script on a part in workspace.

0

What errors are you getting? When you publish, the character rig switches from R6 to R15.

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

0

@Meltdown : Thanks for pointing out the r6 to r15 models ,i just chanched ("Torso") to ("UpperTorso") and now it works fine :)

1 answer

Your most likely in experimental mode.

1 comment

0

FilterEnable is true but when i turn it off its just the same

This discussion is preserved as it was. New answers, comments, and votes are closed.