A quick rundown, it's a morph system for an upcoming dinosaur game. This is a footstep system for when the player is near the dinosaurs (Screenshake)
However,
The code below doesn't work. No errors are produced, and the only thing that prints is "Phase1" Phase 2+ do not print. Any help would be appreciated, thanks! THIS IS NOT A LOCALSCRIPT
print("Phase1")
game.Players.PlayerAdded:Connect(function(Player)
print("Phase2")
script.Parent.Touched:Connect(function(onhit)
if onhit:IsDescendantOf(script.Parent.Parent) then
else
if script.Parent.Parent.IsWalking.Value ==true then
local DT = Player.Character:WaitForChild("DinosaurType")
if DT then
if DT.Value == "Tyrant" then
else
if onhit:IsDescendantOf(Player.Character) then
for i = 1,20 do
local hum = Player.Character.Humanoid
print("Phase3")
local a = math.random(-100,100)/100
local b = math.random(-100,100)/100
local c = math.random(-100,100)/100
hum.CameraOffset = Vector3.new(a,b,c)
wait()
end
end
end
else
for i = 1,20 do
local hum = Player.Character.Humanoid
print("Phase2")
local a = math.random(-100,100)/100
local b = math.random(-100,100)/100
local c = math.random(-100,100)/100
hum.CameraOffset = Vector3.new(a,b,c)
wait()
end
end
end
end
end)
end)

1 comment
+1. Note: Roblox recommends using ":GetPlayers()" instead of ":GetChildren()", though I suppose this only matters if someone stores things in Players (which you shouldn't do).