Hello. Me and my mate are making a tycoon. I'm making a gui for it because I'm bored lol BUT I wanna make a reset character button This is what my workspace and scripts look like
http://screenshot.sh/m3Cokv6QPxAsJ
and the script I'm trying to use.
local player = game.Players.LocalPlayer game.Players.LocalPlayer:BreakJoints()
So when you click the button It will kill you. Please help :]
local player = game:GetService("Players").LocalPlayer script.Parent.MouseButton1Down:connect(function()--if the gui is clicked this happens if player.Character and player.Character:FindFirstChild("Humanoid") then player.Character.Humanoid.Health = 0-- changes health to 0 end end
From what i see it seems as you are fairly new to Studio so here's how it should be in explorer.StarterGui>ScreenGui>Frame>TextBox. Sorry if i mistaken your level of scripting.
This should work (put the script where the text button is the ‘parent’)
script.Parent.MouseClick:Connect(function() game.Players.LocalPlayer.Character.Humanoid.Health = 0 end
Hope this helped you!