Update cubzh.lua
Browse files
cubzh.lua
CHANGED
@@ -294,25 +294,6 @@ local skills = {
|
|
294 |
}
|
295 |
}
|
296 |
|
297 |
-
Client.SpawnSquirrel = function()
|
298 |
-
if Player.Motion.X == 0 and Player.Motion.Z == 0 then
|
299 |
-
-- Player is standing still
|
300 |
-
sfx("squirrel_chirp", { Position = Player.Position, Volume = 0.5 })
|
301 |
-
|
302 |
-
-- Assuming you have a function to spawn entities
|
303 |
-
local squirrel = SpawnEntity("Squirrel", Player.Position + Vector3.new(0, 0, 5))
|
304 |
-
|
305 |
-
gigax:action({
|
306 |
-
name = "FLYINGSQUIRREL",
|
307 |
-
description = "Spawn a squirrel nearby",
|
308 |
-
parameter_types = {},
|
309 |
-
action_format_str = "A curious squirrel appeared near {protagonist_name}.",
|
310 |
-
})
|
311 |
-
|
312 |
-
print("Squirrel spawned near player")
|
313 |
-
end
|
314 |
-
end
|
315 |
-
|
316 |
local locations = {
|
317 |
{
|
318 |
name = "Scientist Island",
|
@@ -495,10 +476,30 @@ Client.OnChat = function(payload)
|
|
495 |
content = msg,
|
496 |
})
|
497 |
|
|
|
|
|
498 |
print("User: " .. payload.message)
|
499 |
return true
|
500 |
end
|
501 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
502 |
onboardingConfig = {
|
503 |
steps = {
|
504 |
{
|
|
|
294 |
}
|
295 |
}
|
296 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
297 |
local locations = {
|
298 |
{
|
299 |
name = "Scientist Island",
|
|
|
476 |
content = msg,
|
477 |
})
|
478 |
|
479 |
+
rotateNPCHead(5)
|
480 |
+
|
481 |
print("User: " .. payload.message)
|
482 |
return true
|
483 |
end
|
484 |
|
485 |
+
function rotateNPCHead(times)
|
486 |
+
local rotations = 0
|
487 |
+
local rotationTimer = Timer.New()
|
488 |
+
local originalRotation = Player.avatar.Head.LocalRotation:Copy()
|
489 |
+
|
490 |
+
rotationTimer:Schedule(function()
|
491 |
+
if rotations < times * 2 then
|
492 |
+
local angle = (rotations % 2 == 0) and math.pi/4 or -math.pi/4
|
493 |
+
Player.avatar.Head.LocalRotation = { angle, 0, 0 }
|
494 |
+
rotations = rotations + 1
|
495 |
+
return 0.2 -- Schedule next rotation in 0.2 seconds
|
496 |
+
else
|
497 |
+
Player.avatar.Head.LocalRotation = originalRotation
|
498 |
+
return false -- Stop the timer
|
499 |
+
end
|
500 |
+
end)
|
501 |
+
end
|
502 |
+
|
503 |
onboardingConfig = {
|
504 |
steps = {
|
505 |
{
|