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

Why won't my attack get copied from ServerStorage?

So, my code won't work. I'm trying to make a boss fight with meteors falling above you, my script is a local script, and my attack is in the server storage. Even when I removed the while loop, it still wouldn't work. So, what's going on and how do I fix it?

while true do
	wait(5)
	local attack = game.ServerStorage.Attack:Clone()
	attack.Parent = workspace
	attack.Position = CFrame.new(game.Players.LocalPlayer.Character.HumanoidRootPart.Position.X,attack.CFrame.Y,game.Players.LocalPlayer.Character.HumanoidRootPart.Position.Z)  
end

1 comment

0

oh yeah, and view the codeblock's source. i really need to make that 5th line shorter :/

1 answer

You can't access ServerStorage with a local script, the name says it, it is ServerStorage, instead you can put the Instance into ReplicatedStorage, it can be accessed by the client and server too.

8 comments

0

ok, i wil try that

0

i'm getting this error now :P Base is not a valid member of Workspace "Workspace"

0

The script that you showed does not have anything about Base so the error is coming from other script.

0

yeah, but i never added the script that's giving this error

0

If you click on the error, it should move you to the script Instance (only in case it is server script). Otherwise i can't really help you as i have no information about it.

0

I removed that script, but still, no dice :(

0

In explorer, there is filter tab in which you can type 'Script' or 'LocalScript', it will find all of the scripts and local scripts in explorer and help you find the script.

0

i found the script already though..

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