I tried to make a gui that resets the player, and gives them a value of 1. That value I used in my second script, which would give them a specific weapon based on if they clicked the gui. Script 1:
local screenGui = Instance.new("ScreenGui")
screenGui.Parent = script.Parent
local textButton = Instance.new("TextButton")
textButton.Parent = screenGui
textButton.Position = UDim2.new(.25, 0, .25, 0)
textButton.Size = UDim2.new(.1, 0, .1, 0)
textButton.BackgroundColor3 = BrickColor.White().Color
textButton.Text = "Peasant"
textButton.Mousebutton1down:connect(function()
game.Players.LocalPlayer.Character.Humanoid = 1
game.Players.LocalPlayer.Character.Humanoid.Health = 0
end)
Script 2:
if game.Players.LocalPlayer.Character.Humanoid == 1 then
game.Lighting["Pitchfork"]:clone().Parent = game.Players.LocalPlayer.Character.Backpack
end
I'm pretty sure it because I messed up with the identifier of 1, I'm not sure if condition statement work with my script. Can someone plz help me! Also, why does clicking the GUI not reset the character? And is there anyway for the gui to disappear after it was clicked?!
