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

ServerScriptService.Script:5: attempt to index upvalue 'ExFie' (a nil value)?

Asked by 5 years ago

`local ExFie = game:GetService("Players").LocalPlayer

game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function()

local GUI = ExFie.PlayerGui.Spown

local SuTart = game:GetService("ReplicatedStorage").SuTart

local Jebus = SuTart:Clone()

Jebus.Name = "SuTart"

local Stuff = Jebus:GetChildren()

local Player = ExFie

Player.Character:ClearAllChildren()

for i,v in pairs(Stuff) do

local Holy = v

Holy.Parent = Player.Character

end

Player.Character.PrimaryPart = Player.Character.HumanoidRootPart

GUI.Enabled = false

end)`

IDK what wrong help me

0
The reason your script doesn't work is its a script and scripts can't access localplayer only local scripts can AnonymousDeveloper13 22 — 5y
0
c o d e b l o c k s LoganboyInCO 150 — 5y

1 answer

Log in to vote
1
Answered by 5 years ago

The reason it doesn't work is server can't access local player, it has to be passed it by the client so I would change your remote event to have the parameter of player which is automatically passed by fireclient .

game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(ExFie)

local GUI = ExFie.PlayerGui.Spown

local SuTart = game:GetService("ReplicatedStorage").SuTart

local Jebus = SuTart:Clone()

Jebus.Name = "SuTart"

local Stuff = Jebus:GetChildren()

local Player = ExFie

...

Basically remove the delcaring of your variable at the top and make it the parameter of your function

0
Why are you defining the player as the player passed if you already know that ExFie is the player passed? DeceptiveCaster 3761 — 5y
0
I'm not it's his original code AnonymousDeveloper13 22 — 5y
Ad

Answer this question