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

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

`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

2 comments

0

The reason your script doesn't work is its a script and scripts can't access localplayer only local scripts can

0

c o d e b l o c k s

1 answer

✓ Accepted answer

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

2 comments

0

Why are you defining the player as the player passed if you already know that ExFie is the player passed?

0

I'm not it's his original code

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