Help Me Change This onTouched To onClicked?
Page 1 of 1
Help Me Change This onTouched To onClicked?
Can someone please change this onTouched script to an onClicked script for me? I want to copy the tool from the ReplicatedStorage into the player's backpack when that specific player clicks the part. I've never made an onClicked script before so I have no clue how to do it. I know that the onTouched script I am using works, but I just would prefer them to be onClicked scripts to get more precise distribution of the tool.
- Code:
Tool=game.ReplicatedStorage["Guava Ice Tea"]
local Debounce=true
script.Parent.Touched:connect(function(Part)
if not Debounce then return end
if Part.Parent:FindFirstChild("Humanoid") then
local player=game.Players:GetPlayerFromCharacter(Part.Parent)
Tool:clone().Parent=player.Backpack
Debounce=false
wait(1.5)
Debounce=true
end
end)
Brisingr360- Posts : 1
Join date : 2015-07-04
Age : 22
Location : Torrance, CA
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum