Script for helicopter appearing at wave doesnt work

  1. What do you want to achieve? - I want to make helicopter appear if it is wave 5 and fly around for a bit then dissaper
  2. What is the issue? - when i reach the wave and map is the one checked for the script just doesnt work
  3. What solutions have you tried so far? - i tried using remote events refrencing the location of values, using waitforchildren for values and including only wave in if statement

ignore the names

local animation = script.Animation
local heli = game.Workspace:WaitForChild("HeliPizza")
local humanoid1 = game.Workspace:WaitForChild("HeliPizza")
local humanoid = humanoid1:WaitForChild("Humanoid")
local anim = humanoid:LoadAnimation(animation)
local mapval = game.Workspace.Values:WaitForChild("EEEEEEEEE")
local waveval = game.ReplicatedStorage.Values:WaitForChild("Wave")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remoteEvent = ReplicatedStorage:WaitForChild("RemoteEvent")


local function check()
	if waveval.Value == 2  then
		humanoid.Base.Transparency = 0
		humanoid.Meshes.Meshes.Transparency = 0
		anim:Play()
		anim.KeyframeReached:Connect(function(keyframeName)
			if keyframeName == "Dissaper" then
				humanoid.Base.Transparency = 1
				humanoid.Meshes.Meshes.Transparency = 1
			end	
		end)
	end
end
1 Like