Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I fix this ServerEvent on this Tank?

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.

1 comment

0

Replicated storage is a parented to the game, not your script (or its parent)

1 answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.