I have tried to make a script that works in a GUI text box but I cannot seem to do it because I just recently started coding. Please tell me where to put the new script and here is a script I tried to code. Edit: The "RopeConstraint" is located in the tool and the default length is 8 and please tell me what type of script to put it in.
function type() local player = game.Players.LocalPlayer local target wait(Random) game.Workspace.Localplayer.FishingRod.RopeConstraint.Length = Parent.Text.Value end
Hi everyone! I have just made a solution to this problem. (It works with a button now, not a text box.)
script.Parent.Activated:Connect(function() if script.Parent.Text == "Retract" then script.Parent.Text = "Fish" game.Players.LocalPlayer.Character.FishingRod.RopeConstraint.Length = 1 else script.Parent.Text = "Retract" game.Players.LocalPlayer.Character.FishingRod.RopeConstraint.Length = 15 end end)