Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Bro how is my title spam this website is so trash?

Im kinda new to scripting and idk why this isnt working also i have my title as that bc this website is so trash and thinks ever title ever is spam

This is the script uh yea

local function kickSpecific()
	local player = game.Players:FindFirstChildWhichIsA("Player")
	if player.Name == script.Parent.Parent.TextBox.Text then
		player:Kick("You Have Been Kickeed By A Dev")
		print("Works yey")
		script.Parent.Parent.TextLabel.Text = "Player Has Been Kicked!"
		wait(2)
		script.Parent.Parent.TextLabel.Text = "..."
	else
		print("No")
		script.Parent.Parent.TextLabel.Text = "Invalid Player"
		wait(2)
		script.Parent.Parent.TextLabel.Text = "..."
	end
end

script.Parent.MouseButton1Click:Connect(kickSpecific)

6 comments

0

This doesn't kick a specific player it gets the first child in the Players service, and kicks them because you used FindFirstChild which is self-explanatory that it just gets the first child

0

I also think this is a Script, so you can't detect player input like for this case MouseButton1Click

0

hmmm yea u could be right

0

What do you think I could do ?

0

Fun fact: Your title is spam. Spam in the sense, it's not spamming, it's merely irrelevant. If this website is trash send the owner, evaera, a whole big ass new theme to the website.

0

Nah bro I legit tried so many things to put as my title like My script isnt working or Can somebody help me with this script but noooooo it didnt allow it so i just put that

1 answer

✓ Accepted answer

I've made this mistake before.

The value inside TextBox is local. You will need to write a local script firing a remote event, carrying the player's name so you can change their gui and the text of the textbox so you can check if its a player, like you did

If you don't know what RemoteEvents are, I understand as you mentioned you are new to scripting, and I recommend you to learn RemoteEvents next.

:)

2 comments

0

Thanks man I used RemoteEvent and it worked

0

ay no problem glad it worked

This discussion is preserved as it was. New answers, comments, and votes are closed.