#Resource Gathering System

31 messages · Page 1 of 1 (latest)

flint tapir
#

cool

fickle plank
#

Raycast / mouse.target ?

flint tapir
#

If mouse.target == "Wood" then
--destroy wood and give wood to player
end

fickle plank
#

function onclick(plr)
if plr.Character:FindFirstChildOfClass("Tool").Name == "ToolName" then
--do something
end
end)
You don't need mouse target because it s a mouse detector

fickle plank
#

Player

fickle plank
#

Connect to the mouse detector

#

script.Parent:Connect(onClick)

#

No

#

Like this +
script.Parent:Connect(onClick)

#

No put it after the last end

#

The script is inside the click detector ?

#

Print something in the function

#

script.Parent.MouseClick:Connect(onclick)

#

Yes

#

If you print something in the script ?

#

It print ?

#

Remove ()

#

add
print("AA") after script'parent'mouseclick...

#

From the explorer click on the script -> properties -> runcontext -> server

#

Does it print AA ?

#

Where is the script ?

#

Workspace ?

#

Any error ?

#

Can you send a screenshot of the explorer (tree and click detector) and the script

#

And the script ?

#

The text, the code

#

if player.Character: FindFirstChildOfClass ("Tool") and player.Character: FindFirstChildOfClass ("Tool").Name == "WoodenAxe" then

#

Is the AA printed ?

#

Did you change the run context ?

#

And there is no error ?

minor escarpBOT
#

studio** You are now Level 6! **studio