Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I make a text box that changes a fishing rod's "Rope Constraint" length? (SOLVED)

Asked by 4 years ago
Edited 4 years ago

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
0
If Parent.Text.Value isn't a numbervalue but a textbox you should use Parent.Text.Text Derzett 51 — 4y
0
Thanks Derzett. I will try that out. G2_funny 0 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

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)
Ad

Answer this question