| |
|
|
| 30 Oct 2012 01:24 PM |
tool = script.Parent tool.Equipped:connect(function(mouse) mouse.Button1Down:connect(function() local click = mouse.Target if click.Parent.Name == "noob" then c = game.Lighting.ShopGui:clone() c.Parent = game.Players:findFirstChild(tool.Parent.Name).PlayerGui elseif click.Parent.Name ~= "noob" then b = Instance.new("Hint") b.Parent = game.Players:findFirstChild(tool.Parent.Name).PlayerGui b.Text="Some Text here" end end) end) |
|
|
| Report Abuse |
|
|
| |
|
|
| 30 Oct 2012 01:27 PM |
Ah, you see, if the mouse is looking into the Sky, there is NO mouse.Target. Do this:
tool = script.Parent tool.Equipped:connect(function(mouse) mouse.Button1Down:connect(function() if mouse.Target then local click = mouse.Target if click.Parent.Name == "noob" then c = game.Lighting.ShopGui:clone() c.Parent = game.Players:findFirstChild(tool.Parent.Name).PlayerGui elseif click.Parent.Name ~= "noob" then b = Instance.new("Hint") b.Parent = game.Players:findFirstChild(tool.Parent.Name).PlayerGui b.Text="Some Text here" end end end) end) |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
|
| 30 Oct 2012 01:46 PM |
tool = script.Parent local CanClick=true local delay=5 tool.Equipped:connect(function(mouse) mouse.Button1Down:connect(function() if mouse.Target then if CanClick then CanClick=false local click = mouse.Target if click.Parent.Name == "Shopkeeper" then c = game.Lighting.ShopGui:clone() c.Parent = game.Players:findFirstChild(tool.Parent.Name).PlayerGui wait(delay) CanClick=true elseif click.Parent.Name ~= "Shopkeeper" then CanClick=false b = Instance.new("Hint") wait() b.Parent = game.Players:findFirstChild(tool.Parent.Name).PlayerGui b.Text="Remember, you must click on a shopkeeper to interact with him/her!" wait(1) b:Destroy() wait(delay-1) CanClick=true end end end) |
|
|
| Report Abuse |
|
|