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

How do I fix this ServerEvent on this Tank?

Asked by 2 years ago
if game.ReplicatedStorage:FindFirstChild("TankStuff") then
    game.ReplicatedStorage.TankStuff:Destroy()
    print("previous instaler destroyed")
end
script.Parent.TankStuff.Parent = game.ReplicatedStorage
script.Parent.ReplicatedStorage.TankGunsFolder.Parent = game.ReplicatedStorage
for _, childP in pairs (game.Players:GetChildren()) do
    local newChild = script.Parent.StarterPlayerScripts.GunSysGiver:Clone()
    newChild.Parent = childP.PlayerGui
    newChild.Disabled = false
end
for _, child in pairs (script.Parent.ServerScriptService:GetChildren()) do
    child.Parent = game.ServerScriptService
    child.Disabled = false
end
script.Parent.StarterPlayerScripts.GunClientScript.Parent = game.StarterPlayer.StarterPlayerScripts
script.Parent.StarterPlayerScripts.TurretScript.Parent = game.StarterPlayer.StarterPlayerScripts
print("tank system instaled")
script.Parent:Destroy()

16:12:01.814 ReplicatedStorage is not a valid member of Folder "Workspace.TonkSpawner.Content" - Server - Installer:6

Any way to fix this? Can't seem to fix the error.

0
Replicated storage is a parented to the game, not your script (or its parent) Kingu_Criminal 205 — 2y

1 answer

Log in to vote
0
Answered by 2 years ago

Try using game instead of script.Parent to access ReplicatedStorage.

Ad

Answer this question