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

ClassicSword is not a valid member of ServerStorage?

Asked by 5 years ago
Edited by theking48989987 5 years ago
01local players = {"TaTzuto0", "gamingmx2", "Utaeba12"}
02local gear = game.ServerStorage.ClassicSword
03 
04game.Players.PlayerAdded:connect(function(plr)
05    plr.CharacterAdded:connect(function(chr)
06        for i = 1, #players do
07            if players[i] == plr.Name then
08                gear:Clone().Parent = plr:WaitForChild("Backpack")
09            end
10        end
11    end)
12end)

4 answers

Log in to vote
-1
Answered by 5 years ago

the sword in ServerStorage isn't loading before your script is running. Be sure to add :WaitForChild() for any objects when referencing them. Also, I would recommend using :GetService() as well. Here's your script but fixed:

01local players = {"TaTzuto0", "gamingmx2", "Utaeba12"}
02local ServerStorage = game:GetService('ServerStorage')
03local gear = ServerStorage:WaitForChild('ClassicSword')
04 
05game.Players.PlayerAdded:connect(function(plr)
06    plr.CharacterAdded:connect(function(chr)
07        for i = 1, #players do
08            if players[i] == plr.Name then
09                gear:Clone().Parent = plr:WaitForChild("Backpack")
10            end
11        end
12    end)
13end)
0
why did i get a dislike? lol AbusedCocopuff4 105 — 5y
Ad
Log in to vote
1
Answered by 5 years ago

make sure the sword is in serverstorage make sure the sword is named right and there are no typos. make sure the script is >serversided. it must be serversided, as localscripts can't access serverstorage.

0
Good answer, poor format ecks-dee Psudar 882 — 5y
0
couldn't find bullet points EmbeddedHorror 299 — 5y
0
accept as answer if it worked EmbeddedHorror 299 — 5y
0
oml scripting helpers stop spamming EmbeddedHorror 299 — 5y
Log in to vote
-1
Answered by 5 years ago
Edited 5 years ago
  • Make sure the sword is in ServerStorage
  • Make sure the sword is named right and there aren't any typos.
  • Make sure its a Script not a LocalScript.

it must be ServerSided, as LocalScripts can't access ServerStorage.

0
wow.... EmbeddedHorror 299 — 5y
Log in to vote
-1
Answered by 5 years ago

I don't know. ServerStorage doesn't have the tool in it anymore

Tried it before, doesn't work

Answer this question