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

Right Leg is not a valid member of Workspace & Left Leg is not a valid member of Workspace?

Asked by 5 years ago

So I'm trying to make it to where once you step on a certain SpawnPoint your torso color changes. I also changed the Starting Character to a default r6 character. If there's any way that this could be fixed It would be great.

local rougSpawn1 = game.Workspace.Terrain.Land.Spawns.RougSpawn
local rougSpawn2 = game.Workspace.Terrain.Land.Spawns.RougSpawn2
local rougSpawn3 = game.Workspace.Terrain.Land.Spawns.RougSpawn3
local rougSpawn4 = game.Workspace.Terrain.Land.Spawns.RougSpawn4


rougSpawn1.Touched:Connect(function(player)

    game.Workspace[player.Name].Torso.BrickColor = BrickColor.new("Sea green")
    game.Workspace[player.Name].Humanoid.MaxHealth = 80
    game.Workspace[player.Name].Humanoid.WalkSpeed = 22
end)

rougSpawn2.Touched:Connect(function(player)

    game.Workspace[player.Name].Torso.BrickColor = BrickColor.new("Sea green")
    game.Workspace[player.Name].Humanoid.MaxHealth = 80
    game.Workspace[player.Name].Humanoid.WalkSpeed = 22
end)

rougSpawn3.Touched:Connect(function(player)

    game.Workspace[player.Name].Torso.BrickColor = BrickColor.new("Sea green")
    game.Workspace[player.Name].Humanoid.MaxHealth = 80
    game.Workspace[player.Name].Humanoid.WalkSpeed = 22
end)

rougSpawn4.Touched:Connect(function(player)

    game.Workspace[player.Name].Torso.BrickColor = BrickColor.new("Sea green")
    game.Workspace[player.Name].Humanoid.MaxHealth = 80
    game.Workspace[player.Name].Humanoid.WalkSpeed = 22
end)

It also seems like after touching the spawn that your maxhealth or speed doesn't change either.

0
why with the rougSpawn values the numbers at the end are indicated as int values? speedyfox66 237 — 5y
0
I'll change it GaemMasta 6 — 5y
0
You have to do game.Workspace.PlayersName User#29913 36 — 5y

1 answer

Log in to vote
0
Answered by
royaltoe 5144 Moderation Voter Community Moderator
5 years ago

The variable inside touch is the brick that hit the touch brick. You'd get the character by saying

if(game.Players:FindFirstChild(nameOfParameterGoesHere.Parent.Name))then
    local player = nameOfParameterGoesHere.Parent
    --all the rest of your code can go here. 
end
0
Thanks GaemMasta 6 — 5y
0
ty royaltoe 5144 — 5y
Ad

Answer this question