Hello,
You seem new to Rbx.Lua.
Things you can learn :
1.LocalPlayer can only be used in a LocalScript.
2.You can use PlayerAdded event to get the joining players.
3.connect
is deprecated , it is better to use Connect
04 | local part = script.Parent |
05 | local gui = game.ReplicatedStorage:FindFirstChild( 'Gui' ) |
06 | local Azarth = gui.Opition.Frame.ImageButtonFinalFlash |
07 | local Azarth 2 = gui.Option.Frame.ImageButtonFinalFlash 2 |
08 | local Azarth 3 = gui.Option.Frame.ImageButtonFinalFlash 3 |
09 | local Azarth 4 = gui.Option.Frame.ImageButtonFinalFlash 4 |
10 | local Bot = gui.Parent.Parent.Suit |
11 | local Flash = Bot.Arm 1. Middle:WaitForChild( "FinalArmCharge" ) |
12 | local Flash 2 = Bot.Chest.Middle:WaitForChild( "FinalCharge" ) |
14 | part.Touched:Connect( function (hit) |
15 | if hit.Parent:FindFirstChildOfClass( "Humanoid" ) and db then |
17 | local player = game.Players:GetPlayerFromCharacter(hit.Parent) |
18 | if player.PlayerGui:FindFirstChild( "Option" ) then |
19 | local g 1 = gui:Clone() |
20 | g 1. Parent = player.PlayerGui |
21 | Azarth:Clone().Parent = g 1. Option.Frame |
22 | Azarth 2 :Clone().Parent = g 1. Option.Frame |
23 | Azarth 3 :Clone().Parent = g 1. Option.Frame |
24 | Azarth 4 :Clone().Parent = g 1. Option.Frame |
That's all for the script.
You need to adjust certain paths and such.
Thank you for reading!
Please upvote this post and accept it as an answer if it helped you.