Still have questions? Join our Discord server and get real time help.
0

# How do i do so when someone touches a brick with a tool it gives the character EXP?

My script does that when i touch it, the brick becomes invisible, but im having trouble with the second part.

Here my script:

script.Parent.Touched:Connect(function(hit) if hit.Parent.Name == "WaterEssence" then script.Parent.Transparency = 0.5 wait(20) script.Parent.Transparency = 0 end

0
You need a variable somewhere in your code so you can increment it. MooMooThalahlah 421 — 2y

0
Leamir 2963
2 years ago
Edited 2 years ago

Hello, SuperBeeperman!

This script will work

script.Parent.Touched:Connect(function(hit)
if game.Workspace:FindFirstChild(hit.Parent.Name) then
if game.Workspace:FindFirstChild(hit.Parent.Name):FindFirstChild("WaterEssence") then
script.Parent.Transparency = 0.5
wait(20)
script.Parent.Transparency = 0
end


Notes:

1 - You don't test for the Tool Name, you test if the player that touched have the item in its Model(Player ir holding) or if have on its backpack(Not holding)

0
Yes but the thing that I was asking is that if you could give me the script that when I touch the brick with the tool it will give EXP, SuperBeeperman 30 — 2y
0
I don't know what is "EXP", is it a Leaderstats? Leamir 2963 — 2y
0
no, it is an intvalue in a folder named leaderstats SuperBeeperman 30 — 2y
0
Use .value to get a Value`s Value Leamir 2963 — 2y