hi help me I can’t do a kick from the server after the explosion here is the script - | wait(60) |
---|---|
workspace.warhedscreen.SurfaceGui.calltruck.Text = self-destruct of the warhead is activated | |
workspace.warhedscreen.SurfaceGui.calltruck.TextSize = 21 | |
workspace[SCP Alpha Warheads]:Play() | |
wait(101.2) | |
workspace.Audios.Effects.Ambience.ring:Play() | |
wait(1) | |
game.Players.PlayerMembershipChanged:Kick(You didn’t survive the explosion of the Alpha warhead) |
1 Like
is this script a LocalScript or a Script? (since you need to use the PlayerGui
not the StarterGui
)
and this is just a regular script
- Please use a code block, by putting ``` on the line above your code.
- Why are you detecting when the players membership changed? That would only run if the players premium runs out whilst playing your game. Also, you can only use :Kick() on a player model, so you’d need to find the player somehow.
- It would run 102.2 seconds after the first line of code.
- In the :Kick() function, you need to have quotations if you want that text to appear when the player is kicked.
- On the first line, you need quotation marks (") after the =, this is because that makes it a string value, and .Text can only intake a string.
I’m sorry I didn’t write that here’s the game.Players.Local players: Strike (“You didn’t survive the Alpha warhead explosion”)
end)
game.Players.localPlayer:Kick("You didn't survive the explosion of the Alpha warhead")
end)
1 Like
There’s 2 issues. Firstly, you spelled it wrong, instead of localPayer you need to have LocalPlayer, secondly, you have a non capital letter at the start.
.LocalPlayer isn’t accessible from a server script
1 Like
I think it’s a client script.
.
try this
- Make a LocalScript inside StarterPlayer > StarterPlayerScripts
-- Local Script
repeat wait() until game.ReplicatedStorage:FindFirstChild("StartEvent")
local event = game.ReplicatedStorage.StartEvent
local player = game.Players.LocalPlayer
wait(60)
local calltruck = player:WaitForChild("PlayerGui"):WaitForChild("SurfaceGui"):WaitForChild("calltruck")
calltruck.Text = "self-destruct of the warhead is activated"
calltruck.TextSize = 21
workspace[SCP Alpha Warheads]:Play()
wait(101.2)
workspace.Audios.Effects.Ambience.ring:Play()
wait(1)
event:FireServer()
- Then replace your whole Script with this
-- Script
local event = Instance.new("RemoteEvent")
event.Parent = game.ReplicatedStorage
event.Name = "StartEvent"
event.OnServerEvent:Connect(function(player)
player:Kick("You didn’t survive the explosion of the Alpha warhead")
end)
I can’t make a kick from the SERVER after the explosion
It’s a server script