Welcome to the Forums!
Join thousands of other Roblox members with a free account.
Create Forum Account

Stuck

  • This website was created by Roblox members to replace the official forums (because Roblox shut them down) Join us if you like Roblox!
Status
Not open for further replies.

Taveple

New Member
Reputation: 0 / 0 / 0
Jul 30, 2020
10
0
1
NA
Roblox
Taveple
Discord
jaakoup#8803
Is it possible for a part to detect the click of a tool and pursue an action, for example change the color? but only for that specific brick.
 

WizardOfHills

Active Member
Reputation: 1 / 0 / 0
Jul 21, 2018
579
7
112
43
Roblox
WizardOfHills
Mouse object has a nice property called Target. However, it appears that Mouse really works only in LocalScript. So again one needs to make an old trick with LocalScript accessing game.Players.LocalPlayer:GetMouse().Target and passing this value via a RemoteEvent to a Script. Then Script can apply change of colour for everyone to see.
 

Taveple

New Member
Reputation: 0 / 0 / 0
Jul 30, 2020
10
0
1
NA
Roblox
Taveple
Discord
jaakoup#8803
Mouse object has a nice property called Target. However, it appears that Mouse really works only in LocalScript. So again one needs to make an old trick with LocalScript accessing game.Players.LocalPlayer:GetMouse().Target and passing this value via a RemoteEvent to a Script. Then Script can apply change of colour for everyone to see.
do i put the local script in the tool with the remote event attached and then it connects to the proper script under the brick that i want to be changed? (im new to scripting, sorry)
 

WizardOfHills

Active Member
Reputation: 1 / 0 / 0
Jul 21, 2018
579
7
112
43
Roblox
WizardOfHills
I propose something like this. However, all kinds of setups may be considered. Anyway, I would keep RemoteEvent and Script together (unless RemoteEvent is in ReplicatedStorage where Scripts do not run.)
SwordSetup.jpg
 
Status
Not open for further replies.