local plr = game.Players.LocalPlayer
local textplace = script.Parent.Parent.resulttext
local Market = game:GetService("MarketplaceService")
local function typeText(text)
for i = 1, #text do
textplace.Text = string.sub(text, 1, i)
wait()
end
wait(7)
textplace.Text = ""
end
script.Parent.MouseButton1Down:Connect(function()
local user = script.Parent.Parent.Username.Text
if game.Players:FindFirstChild(user) then
local result = game.ReplicatedStorage Events.Request:InvokeServer(game.Players:FindFirstChild(user))
typeText(result)
else
script.Parent.Text = INVALID PLAYER."
wait(3)
script.Parent.Text = "Kick player"
end
end)
Server Script:
local Can = false
function KickRequest(Player,PlayerToKick)
if Player and PlayerToKick then
local function kick(player)
player:Kick("You have been kicked")
return "Success"
end
local function detect()
if Player.Name ~= "uugnut6" then
KickRequest()
else
Can = true
return
end
detect()
repeat wait() until Can == true
kick(PlayerToKick)
end
end
Event.OnServerInvoke = KickRequest
I think you mean to do game.ReplicatedStorage.Events? You have a random space between ReplicatedStorage and Events, if you want to print it with the space, do tostring()
I don’t think you have to do game.Players:FindFirstChild(user) again in the local result =, as you already made the script check if game.Players:FindFirstChild(user) then. so, maybe you just have to do game.Players.user? Just maybe.. not too sure..
if game.Players:FindFirstChild(user) then
local player = game.Players:FindFirstChild(user)
local result = game.ReplicatedStorage.Events.Request:InvokeServer(player)