I made a giver that when you touch the part, a screen GUI appears. When the screen GUI appears I wanted it to fire a remote function to the server which then spawns the tool. I believe it has something to do with the Server script when the tool is supposed to spawn, but I'm not sure. I'm just trying to adjust after experimental mode was removed, any help would be appreciated!
--Local Script/Client script.Parent.MouseButton1Click:Connect(function() game.ReplicatedStorage.O1TierEvent:FireServer() end)
--Script/Server game.ReplicatedStorage.O1TierEvent.OnServerEvent:Connect(function() local tool = script.Parent.OrangeswordTier1:Clone() tool.parent = game.Players.LocalPlayer.Backpack end)
--Local Script/Client
script.Parent.MouseButton1Click:Connect(function() game.ReplicatedStorage.O1TierEvent:FireServer() end) game.ReplicatedStorage:WaitForChild("O1TierEvent").OnClientEvent:Connect(function(player,tool) tool.Parent = player:WaitForChild("Backpack") end)
--Script/Server
game.ReplicatedStorage.O1TierEvent.OnServerEvent:Connect(function() local tool = script.Parent.OrangeswordTier1:Clone() game.ReplicatedStorage:WaitForChild("O1TierEvent"):FireClient(player,tool) end)
the server script cant parent the tool to the players backpack since the backpack is on the client (your computer) so it needs to fire the client and then the client will pick this up and connect the tool function and then parent that clone as we created in the server script and parent it to the backpack also when you deal with remote events the best thing is to use :WaitForChild("event name here") just incase its lagging or something so we let the event load in before using it