how its supposed to work is: admin presses a button and it will check who the player they are trying to kick is and to see if there is a specified reason, it will change a few variables in replicated storage and fires off a remote event which tells a server script to call this function
local selectedplayer = nil
local Text = nil
game.ReplicatedStorage.KickEvent.OnServerEvent(function()
selectedplayer = game.ReplicatedStorage.PlayerSel.Value
Text = game.ReplicatedStorage.Text.Value
if Text ~= nil then
game.Players:FindFirstChild(selectedplayer):Kick("you have been kicked becuse:" .. Text)
else
game.Players:FindFirstChild(selectedplayer):Kick("you have been kicked")
end
end)
problem is it keeps saying " ServerScriptService.Script:5: attempt to call field 'OnServerEvent' (a userdata value)"
i have no clue what the means, can anyone help?

1 comment
oml im stupid XD