I have a script that plays a equip animation when the watch is equipped (same with unequip). How can I make it so the watch on the hand is always visible to the player even if they move their camera not in view of the watch?
Script:
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local hum = char:WaitForChild('Humanoid')
local runservice = game:GetService('RunService')
local equiped = false
local holdload = hum:LoadAnimation(script.Parent.Hold)
script.Parent.Equipped:Connect(function()
local equip = hum:LoadAnimation(script.Parent.Equip)
equiped = true
equip:Play()
print('player')
equip.Stopped:Wait()
holdload:Play()
holdload.Looped = true
script.Parent.Screen.SurfaceGui.WatchFrame.Visible = true
end)
script.Parent.Unequipped:Connect(function()
holdload:Stop()
equiped = false
local unequip = hum:LoadAnimation(script.Parent.Unequip)
unequip:Play()
unequip.Stopped:Wait()
script.Parent.Screen.SurfaceGui.WatchFrame.Visible = false
end)
while wait(0.1) do
if hum.WalkSpeed ~= 8 then
hum:UnequipTools()
end
end
You could copy fake arms into the workspace, offset them to the camera’s CFrame, and only the player wearing the watch can see them, ensuring the watch is always on screen and doesn’t appear strange to others.
You could use the current animation to show the watch is equipped to other players. Sorry if I didn’t explain it that well I don’t really know how.
If I am correct what you are basically saying is a viewmodel, and earlier I was thinking about using a viewmodel too. This issue is I don’t know how to get the players shirt onto the viewmodel.
Depending on where the viewmodel is you could probably locally set the shirt to the player’s shirt id. That depends how you actually make the viewmodel though.
I would have to think about more than just the shirt generally but I think it could be done like this.
-- local script located in replicatedstorage
local vshirt = script.Parent --viewmodel shirt location
local plr = game:GetService("Players").LocalPlayer
local chr = plr.Character or plr.CharacterAdded
for i, v in pairs(chr:GetChildren()) do
if v:IsA("Shirt") then
vshirt = v.ShirtTemplate
else
return
end
end