I am VERY NEW to scripting and I am trying to make a script that kills the localplayer if the value is under .2 using math.random(1). i tried multiple times with no success. pls help thx
script.Parent.MouseButton1Click:connect(function() math.random(1) if math <0.2 then game.Workspace.LocalPlayer:BreakJoints() function Break(Player) Player.Character:BreakJoints() end end end)
Thanks in advance!
So you need to set that math.random(), in a variabe.
local number = math.random(1)
And now, under the mouseclick event, pace this in there, so the number is new everytime with the click
script.Parent.MouseButton1Down:Connect(function() local number = math.random(1) end)
so now check for the number with an if statement, and kill the player
if (number < 0.2) then if game.Players.LocalPlayer.Character then game.Players.LocalPlayer.Character:BreakJoints() end end