of     1   

iFallenAtlantis
#165141371Sunday, June 21, 2015 5:47 AM GMT

I have a script that uses a ClickDetector to move a LocalScript to the player's model. But when I press on the brick, the Lua Debugger is pulled up and I can't figure out what I did wrong. I don't have any breakpoints and I have tried FilteringEnabled.
iFallenAtlantis
#165141453Sunday, June 21, 2015 5:49 AM GMT

So here's the script that moves the LocalScript child = script.SpeachScript debounce = false function onPlayerRespawned(newPlayer) local torso = newPlayer.Character.Torso child:Clone().Parent = torso.Parent end function onPlayerEntered(newPlayer) if debounce == false then if newPlayer.Character then onPlayerRespawned(newPlayer) end newPlayer.Changed:connect(function (property) if (property == "Character") and newPlayer.Character then onPlayerRespawned(newPlayer) end end) end debounce = true end script.Parent.MouseClick:connect(onPlayerEntered)
DrSaint
#165141461Sunday, June 21, 2015 5:49 AM GMT

Always post the script and the errors. It's really vague if you just say "It doesn't work!" What doesn't work?
DrSaint
#165141495Sunday, June 21, 2015 5:50 AM GMT

Late post*
DrSaint
#165141574Sunday, June 21, 2015 5:51 AM GMT

Should'nt if debounce == false then be if debounce = false then
iFallenAtlantis
#165142522Sunday, June 21, 2015 6:10 AM GMT

Well, I honestly have no idea what I did wrong. When the debugger is pulled up, it brings up a different script, even though there is nothing wrong with it. I thought the problem was the ClickDetector because the break happens when you click the part.
iFallenAtlantis
#165142589Sunday, June 21, 2015 6:11 AM GMT

So here's the script that is pulled up. function GetMass(object) local mass = 0 if pcall(function() return object:GetMass() end) then mass = object:GetMass() end for _,child in pairs(object:GetChildren()) do mass = mass + GetMass(child) end return mass end function onPlayerRespawned(newPlayer) wait() local torso = newPlayer.Character.Torso local bp = Instance.new("BodyPosition") bp.Name = "TwoD" wait(.1) bp.position = torso.Position bp.P = 1000000 bp.D = 1000000 bp.maxForce = Vector3.new(0, 0, 100000) bp.Parent = torso local bf = Instance.new("BodyForce") bf.force = Vector3.new(0, 100*GetMass(newPlayer.Character), 0) bf.Parent = torso newPlayer.Character.Humanoid.WalkSpeed = 19 script.LocalScript:Clone().Parent = torso.Parent newPlayer.Character.DescendantAdded:connect(function() bf.force = Vector3.new(0, 10*GetMass(newPlayer.Character), 0) end) newPlayer.Character.DescendantRemoving:connect(function() bf.force = Vector3.new(0, 10*GetMass(newPlayer.Character), 0) end) end function onPlayerEntered(newPlayer) if newPlayer.Character then onPlayerRespawned(newPlayer) end newPlayer.Changed:connect(function (property) if (property == "Character") and newPlayer.Character then onPlayerRespawned(newPlayer) end end) end game.Players.PlayerAdded:connect(onPlayerEntered) I have no idea what is wrong.
iFallenAtlantis
#165142675Sunday, June 21, 2015 6:13 AM GMT

And Dr, I tried switching to the "=", but the script checker thing says it's wrong.

    of     1