So I'm making a kick gui using functions
the local script works already but for some reason the server script isn't
local ReplicatedStorage = script.Parent.Parent
local RemoveEvent = ReplicatedStorage.kick
RemoveEvent.Name = "kick"
ReplicatedStorage.kick.OnServerEvent:connect(function(v1,v2)
print('test')
local kname = v1
print(kname)
local kreason = v2
local kp = game.Players:FindFirstChild(kname)
print(kp.Name)
print('test2')
kp:Kick(kreason)
end)
I keep getting this error
attempt to index local 'kp' (a nil value)
EDIT:
here is the localscript
local ReplicatedStorage = script.Parent.Parent.Parent.Parent.Parent.Functions
local RemoteEvent = ReplicatedStorage:WaitForChild("kick")
script.Parent.MouseButton1Click:Connect(function()
local v1 = script.Parent.Parent.kickname.Text
local v2 = script.Parent.Parent.kickreason.Text
print(v1..' | '..v2)
if game.Players:FindFirstChild(v1) then
RemoteEvent:FireServer(v1,v2)
print(v1..' dadd | dadd '..v2)
end
end)

1 comment
oof I forgot to delete line 3 lol