Hello. Im trying to make a fighting game and i have got gui and everything. When i press the button for the gun in the editor i get it but not in the actual game. There it doesnt work
so i have a screengui with a textbutton in it the textbutton i made a localscript which holds following code:
script.Parent.MouseButton1Click:Connect(function()
local plr = game.Players.LocalPlayer
local Event = game.ReplicatedStorage.Equipped
Event:FireServer("Aug")
end)
the screengui is in serverstorgae
in the serverstorage is also my tool called "Aug"
in serverscriptservice i have a normal script with following code:
game.Players.PlayerAdded:Connect(function(plr)
local CloneMe = game.ServerStorage.ScreenGui:Clone()
CloneMe.Parent = plr.PlayerGui
end)
-------------------------------------------------------------------------------------------------------------------------------------------------------
game.ReplicatedStorage.Equipped.OnServerEvent:Connect(function(plr,Message)
local Weapon = game.ServerStorage:FindFirstChild(Message)
Weapon:Clone()
Weapon.Parent = plr.Backpack
end)
and i have a remoteevent called "Equipped" in replicatedstorage
I would appreciate any help

4 comments
Why aren't all these items/scripts/remotes within ReplicatedStorage? Then a RemoteHandler type folder with the respective remote scripts, if needed, in ServerScriptService...
First of all, if the screen gui is already going to be added to the player then just place it under starter gui?
No.
ok... and why not?