I’m trying to create a Kick GUI but it doesn’t seem to work.
Main Script
local player = game.Players.LocalPlayer
--//Kick System
local KickUser = script.Parent.KickBox.Text
script.Parent.KickButton.Activated:Connect(function()
game.Players(KickUser):Kick()
end)
If you know what’s wrong please tell me! Thanks
I’m not sure what you’re trying to achieve with this line:
Would TextBox.InputEnded
achieve what you’re trying to do?
https://developer.roblox.com/en-us/api-reference/class/TextBox
Make sure that you are defining KickUser
within the Event, otherwise it will remain unchanged.
That line detects if a TextButton is activated. Then, calls a function.
Just realized that, my bad.
Do try this though:
1 Like
Spraden
(Spraden)
April 25, 2020, 7:51am
#5
Don’t forget this code is being run in a LocalScript, the Kick line needs to be run from the server.
Use a Remote Event to achieve this.
1 Like
Well, now that it was edited to actually :Kick()
the Player, yes. Beforehand he simply wanted to print the inputted name.
2 Likes
Wow. So simple by just putting the KickUser into the event. Tysm lol
1 Like