So here is you original code in a code block so its easier to read a few things that I can see that maybe causing an error is first if a objects name has a space in it you will want to put it in brackets with quotes instead of how you currently have it as the code does not know what you are looking for if there is a space because it thinks that's a different line of code
The second which is more of a question is you are storing an event as a variable while I don't believe there is anything wrong with it that makes no real sense to me or anyone else why its set up like that
Original Code:
script.Parent.button.MouseButton1Click:Connect(function()
local Fire = game.ReplicatedStorage.Weapons Fire:FireServer(script.Parent.Parent.Loadout.Value)
script.Parent.Parent:TweenPosition(UDim2.New(2,0,.1,0),"Out","Quad", 1)
end)
So to make it function you would like your code more like this:
script.Parent.button.MouseButton1Click:Connect(function()
game.ReplicatedStorage["Weapons Fire"]:FireServer(script.Parent.Parent.Loadout.Value)
script.Parent.Parent:TweenPosition(UDim2.New(2,0,0.1,0),"Out","Quad", 1)
end)
That should allow your code to actually function and fire sorry if the top seemed a bit rude its just I as well as many others where very confused about the layout of your code.
so remember if a part name you are looking for has a space you will need to set up the path to look like this
game.ReplicatedStorage["Weapons Fire"]
game.ReplicatedStorage.Weapons Fire
2 comments
Why are you saving a FireServer in a variable
Please put your code in a lua code block so people can understand it better.