So basically it's an animation tool so it's not a Roblox gear, so would there be a way for only certain people or certain people from a rank to have it available or visible to them?
script.Parent.Equipped:connect(function(m) m.Button1Down:connect(function() hum = game.Players.LocalPlayer.Character.Humanoid anim_feet = hum:LoadAnimation(script.Parent.Animation) current = anim_feet current:Play() end) end)
Hi Cantbeatmerbro,
local players = game:GetService("Players"); local rs = game:GetService("ReplicatedStorage"); local allowed_to_have_tools = { ["KingLoneCat"] = true; ["Cantbeatmerbro"] = true; ["Player1"] = true; } local parent_ev = rs:WaitForChild("Parent To Current Camera"); players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(char) if allowed_to_have_tools[char.Name] then parent_ev:FireClient(player); end end) end)
local cam = workspace.CurrentCamera; local rs = game:GetService("ReplicatedStorage"); local parent_ev = rs:WaitForChild("Parent To Current Camera"); parent_ev.OnClientEvent:Connect(function() local tool = script:WaitForChild("Tool To Make Visible"); tool.Parent = cam; end)
I used a RemoteEvent
to communicate between the ServerScript
and a LocalScript
. You might be wondering why I used a LocalScript
, and that's simply because you need a LocalScript
to access CurrentCamera
. CurrentCamera
is where all local things go, so if you want there to be parts that only one Player
can see, then you'd place it in the CurrentCamera
.
Thanks,
Best regards,
~~ KingLoneCat