So, in a game I’m working on, I added a little easter egg where you die inside of a truck
That’s basically it, but the script to kick the player after the text has finished isn’t working.
Here’s the script.
local text = script.Parent
local blur = Instance.new("BlurEffect",game.Workspace.CurrentCamera)
local darkness = Instance.new("ColorCorrectionEffect",game.Workspace.CurrentCamera)
blur.Size = 4
wait(.3)
text.Text = ("What? Where, am I?")
wait(10)
text.Text = ("I feel dizzy, I think I'm going to pass out.")
wait(10)
text.Text = ("Is this really how I die?")
wait(10)
text.Text = ("Surrounded by an empty abyss?")
wait(10)
text.Text = ("I know nobody will answer my calls for help.")
wait(10)
text.Text = ("Earth was a nice place. Goodbye friends and family.")
wait(2)
text.Active = false
blur.Size = 48
darkness.Brightness = 0
game.Players.LocalPlayer:kick("You have died.")
Everything works fine, besides the kick script at the end. I just want this to work so I can release this easter egg.
No, lowercase kick isn’t supposed to work. Kick is a new method so it was implemented using standard Roblox naming conventions (PascalCase). It wasn’t implemented at a time where lowercase methods were dominant, therefore does not have a deprecated lowercase alias.
The error is literal. What this is saying is that LocalPlayer is nil because Kick is an index of the Player (an Instance method, specifically), kind of like what you see with tables. You’re using a server script, for which LocalPlayer does not exist for. You should never be using a server script for PlayerGuis, only firing remotes to tell the client to make changes.