Scripting GUI Gone wrong

Hii so im trying to make a very simple dress up menu i.e a player clicks a button and gets an accessory but suddenly after adding in multiple remote events (with different names) it stopped working and I’m not sure why.

here is what the client-side script looks like: (this works fine)

function F1()
print(‘So did it work?’)
local ReplicatedStorage = game:GetService(“ReplicatedStorage”)
local remoteEvent = ReplicatedStorage:WaitForChild(“F1Change”)

local player = game.Players.LocalPlayer
remoteEvent:FireServer(player)
script.Parent.Parent.Parent.Enabled = false
print(player)

end

script.Parent.Activated:Connect(F1)

And here is the server script: (this seems to not work at all ~ doesn’t print anything or give the accessory but it also doesn’t return any errors)

local ReplicatedStorage = game:GetService(“ReplicatedStorage”)
local remoteEvent = ReplicatedStorage:WaitForChild(“F1Change”)

local function outfit (player)
local name = player.name
print (name,“has activated the event”)

local accessory = game.ServerStorage.CPurple:Clone()
accessory.Parent = player.Character
--local humanoid = player.Character.Humanoid
--humanoid:AddAccessory(accessory)
--humanoid.hipheight = 4.2

end

remoteEvent.OnServerEvent:Connect(outfit())

Screenshot_3669
Screenshot_3672
Screenshot_3673

1 Like

Remove the (), you’re passing the result of the function “outfit” which is nil, you should be passing the function itself.

2 Likes

Maybe dont do activated do Mousebutton1Down or something like that

Thank you so much! It works now!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.