local plrs = {"DarkFlameCrimsonXana", "PrimeCrimson", "RebornProductions", "Delshark44"} local bs = script.Parent function onTouch(Brick) local Player = Brick.Parent:findFirstChild("humanoid") if (Player.Name == (plrs))then Player.Walkspeed = 100 end end bs.Touched:connect(onTouch)
I don't get why it's not working, the output shows no errors and yet it's not working...
Your if
statement on line 6 is checking if their name is a Lua Table, which it obviously isn't.
To fix this, let's make this a Dictionary and change line 6:
local plrs = {DarkFlameCrimsonXana = true, PrimeCrimson = true, RebornProductions = true, Delshark44 = true} local bs = script.Parent function onTouch(Brick) local Player = game.Players:GetPlayerFromCharacteR(Brick.Parent) --This is a better method of getting the Player's name if it exists. if (plrs[Player.Name])then Player.WalkSpeed = 100 end end bs.Touched:connect(onTouch)
local plrs = {"DarkFlameCrimsonXana", "PrimeCrimson", "RebornProductions", "Delshark44"} local bs = script.Parent function onTouch(Brick) local Player = Brick.Parent:findFirstChild("Humanoid") --Capitalized H for i,v in pairs(plrs) do if Player.Parent.Name==v then Player.Walkspeed = 100 -- You might have to write WalkSpeed idk i forgot but try it like this end end bs.Touched:connect(onTouch)