Hi, when the player overlaps the trigger object i want the player to change its animation.
This is the script i have so far..
local TRIGGER = script:GetCustomProperty("trigger"):WaitForObject()
local GEO = script:GetCustomProperty("GEO"):WaitForObject()
local ROTATE = script:GetCustomProperty("rotate")
local player = Game.GetLocalPlayer()
GEO:RotateContinuous(ROTATE)
function Pickup()
print (player.name)
player:PlayAnimation("unarmed_dance_basic")
end
TRIGGER.beginOverlapEvent:Connect(Pickup)
I receive this error warning..
Error running Lua task: [7F1EE80E63D74E36] PickUpScript:12: attempt to call a nil value (method 'PlayAnimation')
Any help is greatly appreciated.