I was making a class load out with GUI I have using this script but the Output said that:
****18:18:13.574 - Script 'Players.Kyle_TPD.PlayerGui.ScreenGui.Frame.Confirm.LocalScript', Line 1
Here is the srcipt:
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 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) --change .Weapons Fire --> ["Weapons Fire"] 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"]--to the script this looks like a path game.ReplicatedStorage.Weapons Fire--to the script this looks like two different lines of code because of the space