Accomplishment:
I am working on a death script, I already the animations done, I have to get the GUI to show up on the screen.
Problem:
The problem is an error. I don't know why the computer can't under stand what i'm trying to say.
Error:
Workspace.KillBrick.wasted:3: attempt to index a nil value. Stack Begin Script 'Workspace.KillBrick.wasted', Line 3 Stack End
Prediction
My prediction is that I need to verify that the object that hits the brick is a player.
Script:
script.Parent.Touched:connect(function(player) -- When the brick is touched
local gui = game.ServerStorage.Wasted:Clone() -- Cloning the gui
gui.Parent = game.Players:GetPlayerFromCharacter(player).PlayerGui -- Error
script.Parent.CanCollide = false - -So the GUI won't get cloned more than once.
wait(6)
script.Parent.CanCollide = true
game.Players:GetPlayerFromCharacter(player).PlayerGui.Wasted.Parent = game.ServerStorage
end)

1 comment
The part will get touched if cancollide is set to false still so I added a toggle