what the script is supposed to do is when i press "R" it will remove my humanoid and then make me respawn after 3 seconds, which it does. But it's also supposed to make this ScreenGui pop up saying "YOU FOOL" but it only pops up after i respawn. It even puts it in the wrong spot! Please help me if you know the answer to my problem and my script is:
local UIS = game:GetService('UserInputService')
local player = game.Players.LocalPlayer
UIS.InputBegan:Connect(function(input, poo)
if poo then return end
if input.KeyCode == Enum.KeyCode.R then
local hum = player.Character:WaitForChild('Humanoid')
if hum ~= nil then
game.StarterGui.youfool.TextLabel.Position = UDim2.new({0.384, 0},{0.409, 0})
wait(0.1)
hum:Destroy()
wait(3)
player:LoadCharacter()
end
end
end)
and yes i put the ScreenGui in the right place for the script
it also is a local script

3 comments
Yes, I'm new to scripting, and I'm not sure if it pops up on just one client or the whole server. If you know if it pops up on the whole server or client, please tell me and I want it just to pop up on the client's screen (the person who pressed R)
About the "ScreenGui only pops up when i die", there's a setting in the gui itself, it toggles if the gui resets when the player respawns. It's called "ResetOnSpawn". You can toggle that so your gui doesn't appear on death.
okay, thanks!