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

Why do these not work?

These are just some scripts im practicing with to get used to Local Scripts Both Connect to each other.

here is script 1.

local p = game.Players.LocalPlayer
while wait() do
	if p.Name == "Player1" then
		local x = game.ServerScriptService.LocalScript
		n = x:Clone()
		n.Parent = p
	end
end

Here is the second one

local p = game.Players.LocalPlayer
local t = p.StarterGear

local x = game.ServerStorage.Gun

m = x:Clone()
m.Parent = t

1 comment

0

Are you getting any output? What are you expecting to happen? Is anything happening at all?

1 answer

LocalScripts don't have access to the ServerScriptService or the ServerStorage service.

Use ReplicatedStorage instead. Things in here are replicated to clients -- meaning LocalScripts have access to the objects on the client's copy of the world.

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