Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 2 years ago
Edited 2 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

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)
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 MarkedTomato 810 — 2y
0
I also think this is a Script, so you can't detect player input like for this case MouseButton1Click MarkedTomato 810 — 2y
0
hmmm yea u could be right Itsyaboyhands 6 — 2y
0
What do you think I could do ? Itsyaboyhands 6 — 2y
View all comments (2 more)
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. greatneil80 2647 — 2y
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 Itsyaboyhands 6 — 2y

1 answer

Log in to vote
0
Answered by 2 years ago
Edited 2 years ago

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.

:)

0
Thanks man I used RemoteEvent and it worked Itsyaboyhands 6 — 2y
0
ay no problem glad it worked Agent_EpicNoob 71 — 2y
Ad

Answer this question