Im trying to make a tool that when you equip it, a Gui would appear and it would let you change the lenght of four ropes. I first tried whit a local script inside the button, and obiusly, only the player could see the ropes changing length, but the server didnt. So then i tried to make a server script that detects when a player joins and it gets the player name, and then when the player clicks a button, the ropes at the tool will be longer, and if the rope was longer than 25 studs, the rope wont get longer.
game.Players.PlayerAdded:Connect(function(jag) -- Detects the player
game.Players[jag.Name].PlayerGui.Scs.Frame.Down.MouseButton1Click:Connect(function() -- detects when the player clicks the button
script.Parent.Handle.R1.Length = script.Parent.Handle.R1.Length + 1
script.Parent.Handle.R2.Length = script.Parent.Handle.R2.Length + 1
script.Parent.Handle.R3.Length = script.Parent.Handle.R3.Length + 1
script.Parent.Handle.R4.Length = script.Parent.Handle.R4.Length + 1 -- these four make the ropes longer
if script.Parent.Handle.R1.Length > 25 then -- this is the length limit
script.Parent.Handle.R1.Length = 25
script.Parent.Handle.R2.Length = 25
script.Parent.Handle.R3.Length = 25
script.Parent.Handle.R4.Length = 25
end
end)
end)
R1, R2, R3, and R4 stand for Rope 1 rope 2 rope 3 and rope 4.
Forgot to mention, the ropes are IN the tool
(Also, sorry for my poor english, is not my main language and i didnt used the translator)
