hasoco
(kan ye)
January 9, 2023, 1:51am
#1
Here’s a video of it not working:
Here’s the code:
local plrs = game:GetService("Players")
local DeathT = script.Parent:WaitForChild("Death")
local plr = plrs.LocalPlayer or plrs.PlayerAdded:Wait()
DeathT.Parent.Enabled = false
local TweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(3)
local tween = TweenService:Create(DeathT,tweenInfo,{["BackgroundTransparency"] = 0, ["TextTransparency"] = 0})
local tween2 = TweenService:Create(DeathT,tweenInfo,{["BackgroundTransparency"] = 1, ["TextTransparency"] = 1})
local char = plr.Character or plr.CharacterAdded:Wait()
local hum = char:WaitForChild("Humanoid")
local tableOfPhrases = {" got fried!", " got dundendun did brodda"," watched an among us animation video", " literally exploded"}
local runService = game:GetService("RunService")
hum.Died:Connect(function()
DeathT.Parent.Enabled = true
tween:Play()
local randNumber = math.random(1,#tableOfPhrases)
DeathT.Text = plr.Name .. tableOfPhrases[randNumber]
task.wait(2.5)
tween2:Play()
end)
Sorry for posting a lot, but I really do need help.
1 Like
Nemigod77
(Nemigod77)
January 9, 2023, 1:53am
#2
Is this in the client or server. I had this issue for months until I put it in the server.
Put this in the server:
game:GetService("Players").PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
Character:WaitForChild("Humanoid").Died:Connect(function()
print(Player.Name .." has dead")
end)
end)
end)
hasoco
(kan ye)
January 9, 2023, 1:54am
#3
It is a client-sided script in ScreenGui. Should I make it a server-sided script?
L7_M
(L7_M)
January 9, 2023, 1:57am
#4
That might be better.
This is a far fetched idea, but I think because the player died, Humanoid.Died does not execute on the client because the player has respawned before it can execute.
hasoco
(kan ye)
January 9, 2023, 1:58am
#5
That works, it printed more than once.
Nemigod77
(Nemigod77)
January 9, 2023, 1:59am
#6
Indeed, Also howdy again. You must go around helping others. I like I am doing right now.
1 Like
hasoco
(kan ye)
January 9, 2023, 1:59am
#7
Then how would I go about fixing it?
L7_M
(L7_M)
January 9, 2023, 1:59am
#8
Just putting it on the server should fix it, per @Nemigod77 's response
Nemigod77
(Nemigod77)
January 9, 2023, 2:00am
#9
Did you put it twice. Else put it in both client and server. Never had that happen.
hasoco
(kan ye)
January 9, 2023, 2:03am
#10
It works now, thank you for your help.
system
(system)
Closed
January 23, 2023, 2:04am
#11
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.