So I'm testing out a script that is only supposed to give a player speed if their name is in the code. I've never messed with any code like this and I've had a few attempts with no luck. Any help would be awesome!
local object = script.Parent
local player = workspace
local allowedPlayers = {"M9F"}
local function giveSpeed(hit)
if hit.Parent:FindFirstChild("Humanoid")then
if hit.Parent == allowedPlayers then
print("hi")
hit.Parent.Humanoid.WalkSpeed = 50
end
end
end
object.Touched:Connect(giveSpeed)

6 comments
you posted just as I figured it out lol
LOL, what timing thanks for the rep
LOL, what timing thanks for the rep
No problem also if I would like to add multiple names how would I go by doing that?
this is what I tried but it didn't work
("Yoricle".."M9F")