✓ Accepted answer
In order to do this, you would have to access the players mouse. Try this:
function hold(Plr)
script.Parent.Transparency = 1
local Val=Plr.PlayerGui.MouseValue
repeat wait() until Val.Value==false or Plr==nil
script.Parent.Transparency=0
end
script.Parent.ClickDetector.MouseClick:connect(hold)
Try using that script. I think that it should work, but if not, leave a comment below, and I'll see what I can do.
UPDATE:
Put that first script I updated in the original brick, and then put a BoolValue (Name it MouseValue(Or something else)) in the Startergui with this LOCALscript in it:
Plr=game.Players.LocalPlayer
Mouse=Plr:GetMouse()
Mouse.Button1Down:connect(function()
script.Parent.Value=true
end)
Mouse.Button1Up:connect(function()
script.Parent.Value=false
end)
Sorry about the long wait. This is untested only because I don't have time right now. Go ahead and test it and tell me how it works. Make sure you do everything correctly, and I think it should. Again, sorry for the long wait.
13 comments
wait when i tested it not on roblox studio it did not work
Are you sure? I tested it and it worked perfectly. If somethings wrong, i'll try to fix it, but as far as I can see it should work fine.
so your sure you tested it in a real game not in roblox studio?
Oh...I see. I'll work on it, hold on.
Sorry about the long wait. It's not tested because I don't have time right now, but I did update it. Follow the instructions and it should work fine I think. Hope I helped :P
I did not work i think the problem is around Val in the first script
Whoops, fixed it. Try it now. Sorry about that...
Sorry to say but it only turned invisible so :(
Ermagerd, sorry. Wait till I get to an actual computer tonight and i'll test it myself before making another update. Sorry about how long this is takin, i wont give up tho.
thanks :)
Ok, finally! I got it to work and it's tested this time. So sorry about how long that took, but I think I got it this time. Please let me know just to make sure :P
thanks it works sorry i did not check it for 2 days i did not had time to go on the computer :)
Lol no prob.