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

Whats wrong with this function?

Asked by 9 years ago

It dosent work in play but it works in play solo.

function hosecop()
    wait()
    player.Character.Torso.CFrame = CFrame.new(Vector3.new(5,10,10))
    wait(1)
    player.Character.Humanoid.Health = 0
    nextpage.Visible = false
    lastpage.Visible = false
    robberpage.Visible = false
    coppage.Visible = false
    wait()

end


chosecop.MouseButton1Down:connect(hosecop)

1 answer

Log in to vote
0
Answered by 9 years ago

first, you need to declare what chosecop is. Then you will need to declare player, nextpage, lastpageand coppage. That is why it's not working. Good try though!

chosecop.MouseButton1Click:connect(function(player) --Something gets clicked and the player is immediately defined.
player.Character.Torso.CFrame = CFrame.new(5,10,10) --Moves the character to 5,10,10
player.Character.Humanoid.Health = 0 --kills the player
end)
Ad

Answer this question