This is a Script
in game.Workspace
:
game.Players.PlayerAdded:connect(function(Player) local SSS = game:GetService("ServerScriptService") game:WaitForChild("ServerScriptService") Player:WaitForChild("PlayerGui") local PlayerGui = Player.PlayerGui local AM = script.Admin AM.Parent = game.ServerScriptService AM.Disabled = false local c = script.Login:Clone() c.Parent = PlayerGui end)
And this is a LocalScript
that gets cloned to game.Players.PLR.PlayerGui.Login.PassBox
:
script.Parent:TweenPosition(UDim2.new(0.5, -227, 0.5, -60)) script.Parent.Exit.MouseButton1Click:connect(function() script.Parent:TweenPosition(UDim2.new(0.5, -227, 2, 0)) wait(1) script.Parent.Parent:Destroy() end) script.Parent.Login.MouseButton1Click:connect(function() local LoginVal = game.ServerScriptService.Admin.Login LoginVal.Value = script.Parent.PasswordBox.Text script.Parent:TweenPosition(UDim2.new(0.5, -227, 2, 0)) wait(1) script.Parent.Parent:Destroy() end)
So what happens is, the "Admin" script is supposed to get put into ServerScriptService
by changing the .Parent
property. It works fine in the Studio, but not in the real game. If anyone knows what's going on or how to fix it, please let me know. Please use code to answer it.
LocalScripts don't have access to "ServerScriptService". The Server does not send that information to clients.
Anything access by a LocalScript has to be in a replicated service like ReplicatedStorage
.
EDIT: I'm not sure why you interpretted this as "put your localscripts in replicatedstorage".
**LocalScripts don't have access to "ServerScriptService". **.
has to be in a replicated service like
ReplicatedStorage
.
The logical inference here is to move what was in ServerScriptService into ReplicatedStorage.