circa555Join Date: 2010-08-25 Post Count: 953 |
script.Parent.Touched:connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
player.Backpack.explode:FireClient(player)
player.Backpack.explodesound:Play()
wait(0.1)
script.Disabled = true
end
end)
Ive been trying but idk what im doing wrong, I'm not a noob i swear Q.Q
|
|
circa555Join Date: 2010-08-25 Post Count: 953 |
anyone?
|
|
circa555Join Date: 2010-08-25 Post Count: 953 |
halp
|
|
|
TechanteJoin Date: 2011-10-17 Post Count: 2101 |
function onClicked(player)
if player then
player.Backpack.explode:FireClient(player)
player.Backpack.explodesound:Play()
wait(0.1)
script.Disabled = true
end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked) |
|
circa555Join Date: 2010-08-25 Post Count: 953 |
its in .Touched form right now, I need it in clicked (and no you cant just switch the functions only. I tried a lot of things but cant get it.)
|
|
|
oh nvm, its similar to this script but you'll need click detector in part and convert 'touched' to 'ClickDetector.MouseClicked'. |
|
circa555Join Date: 2010-08-25 Post Count: 953 |
@Tech but do I need a click detector then?
|
|
TechanteJoin Date: 2011-10-17 Post Count: 2101 |
I think it should automatically add one, but if it doesn't add one anywayz for the lols |
|
circa555Join Date: 2010-08-25 Post Count: 953 |
actually, im using a screengui so click detactor wont work
|
|
TechanteJoin Date: 2011-10-17 Post Count: 2101 |
Umg kid I'm gonna eat your cat.
Ok, try this:
function onClicked()
local player = script.Parent.Parent.Parent.Parent
if player then
player.Backpack.explode:FireClient(player)
player.Backpack.explodesound:Play()
wait(0.1)
script.Disabled = true
end
end
script.Parent.MouseButton1Click:connect(onClicked) |
|
iiEssenceJoin Date: 2014-06-18 Post Count: 3467 |
function onClicked(player)
if player then
player.Backpack.explode:FireClient(player)
player.Backpack.explodesound:Play()
wait(0.1)
script.Disabled = true
end
end
theTextButton.MouseButton1Click:connect(onClicked) |
|