Answered by
5 years ago Edited 5 years ago
Firstly, put your ClientScript (LocalScript) on your tool. secondly put a new RemoteEvent and a new ServerScript (Script) in this tool. Now I start from the principle of you use a ScreenGui with on that a TextButton and a Tool.
We go to found the player on the ClientScript (LocalScript) like that
1 | local Player = game:GetService( 'Players' ) |
it's just a link. You can view this instance when you play on studio and you open the "Players" service on the explorer like that
Now you have see on this instance we've Backpack and PlayerGui. In the PlayerGui you can found your ScreenGui like that
1 | local Player = game:GetService( 'Players' ) |
2 | local PlayerGui = Player:WaitForChild( 'PlayerGui' ) |
3 | local YOUR_SCREENGUI = PlayerGui:WaitForChild( 'YOUR_SCREENGUI_NAME_HERE' ) |
What's WaitForChild? Click here to see the Dev page
Now we've access to your UI! Congrats! Now your script look like this!
01 | local Tool = script.Parent |
02 | local Remote = Tool.RemoteEvent |
04 | local Player = game:GetService( 'Players' ) |
05 | local PlayerGui = Player:WaitForChild( 'PlayerGui' ) |
06 | local YOUR_SCREENGUI = PlayerGui:WaitForChild( 'YOUR_SCREENGUI_NAME_HERE' ) |
08 | YOUR_SCREENGUI.TextButton.Activated:Connect( function () |
Now go to your ServerScript (Script) and write thats!
01 | local Tool = script.Parent |
02 | local Remote = Tool.RemoteEvent |
06 | Remote.OnServerEvent:Connect( function () |
09 | Tool.Blade.Transparency = 0.3 |
10 | Tool.Blade.Transparency = 1 |
Here's how to make an FE tool. If you have any questions ask them below!