please help me:i cant figure out how to find a single player model in a server script?
hi help me pls i cant figure out how to find a single player model in a server script
local script
02 | local staff = script.Parent |
03 | local output = staff:FindFirstChild( "Energizer" ) |
04 | local player = game:GetService( "Players" ).LocalPlayer |
07 | character = player.Character |
10 | local hum = character:WaitForChild( "Humanoid" ) |
11 | local repstorage = game.ReplicatedStorage |
15 | local equipR 6 = repstorage.equipR 6 |
16 | local equipR 15 = repstorage.equipR 15 |
19 | function equipAnim(player) |
21 | if character:FindFirstChild( "Lower Torso" ) then |
23 | local equipCallR 15 = equipR 15 :InvokeServer() |
24 | elseif character:FindFirstChild( "Torso" ) then |
26 | local equipCallR 6 = equipR 6 :InvokeServer() |
31 | staff.Equipped:Connect(equipAnim(player)) |
server script
03 | local repstorage = game.ReplicatedStorage |
06 | local equipR 15 = repstorage:WaitForChild( "equipR15" ) |
07 | local equipR 6 = repstorage:WaitForChild( "equipR6" ) |
11 | function playEquipAnimR 6 (player) |
12 | if game.Workspace [ player.Name ] :FindFirstChild( "Torso" ) then |
13 | local equipR 6 = Instance.new( "Animation" ) |
15 | local equipAnimTrackR 6 = hum:LoadAnimation(equipR 6 ) |
16 | equipAnimTrackR 6 :Play() |
20 | function playEquipAnimR 15 (player) |
21 | if game.Workspace [ player.Name ] :FindFirstChild( "Lower Torso" ) then |
22 | local equipR 15 = Instance.new( "Animation" ) |
24 | local equipAnimTrackR 15 = hum:LoadAnimation(equipR 15 ) |
25 | equipAnimTrackR 15 :Play() |
29 | equipR 6. OnServerEvent = playEquipAnimR 15 () |
30 | equipR 15. OnServerEvent = playEquipAnimR 15 () |