Help Me Change This onTouched To onClicked?

Go down

Help Me Change This onTouched To onClicked? Empty Help Me Change This onTouched To onClicked?

Post  Brisingr360 on Sat Jul 04, 2015 12:38 pm

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
Brisingr360

Posts : 1
Join date : 2015-07-04
Age : 17
Location : Torrance, CA

View user profile

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum