|
This was the script if you did not believe me.
881 lines.
--------Rage Skripts
wait()
math.randomseed(tick());
local Default = 'Terrain_Grass' -- The Default Footstep sound
local function sleep(delta, expected)
if delta < expected then
delta = delta + wait(expected) - expected
else
delta = delta - expected
end
return delta
end
--UDim2 variables
local PlayerGui = script.Parent;
local UDim2_new = UDim2.new;
local OriginalTween = UDim2_new(0,0,0,0)
local NegativeTween = UDim2_new(-1.5,0,0,0);
--Mathematical Variables
local math_random = math.random;
local math_abs = math.abs;
local math_rad = math.rad;
local math_cos = math.cos;
local math_acos = math.acos;
local math_sin = math.sin;
local math_deg = math.deg;
-- Coroutines
local coroutine_create = coroutine.create;
local coroutine_resume = coroutine.resume
--Table Manipulation
local table_concat = table.concat;
local table_insert = table.insert;
--Instancing
local Instance_new = Instance.new;
--Vector3 Variables
local Vector3_new = Vector3.new;
--Mathematical Variables
local math_min = math.min;
--CFrame Variables
local CFrame_new = CFrame.new;
--Rays
local Ray_new = Ray.new;
-- Bools
local frozen = false;
-- Heirarchical
local Storage = game:GetService("ReplicatedStorage");
local Lighting = game:GetService("Lighting");
local StarterGui = game:GetService("StarterGui")
local Debris = game:GetService('Debris');
local InsertService = game:GetService('InsertService');
local ContentProvider = game:GetService('ContentProvider');
local Players = game:GetService('Players');
local Player = Players.LocalPlayer;
Player.CameraMode = 'LockFirstPerson'
--Color
local Color3_new = Color3.new;
------------------------------------------------Client Variables
local Beat = Instance_new("Sound",PlayerGui)
Beat.Name,Beat.SoundId,Beat.Pitch,Beat.Volume = 'HeartBeat',
'http://www.roblox.com/asset/?id=25641879',.1,.5;
local Receiver = Instance.new("BoolValue",Player);
Receiver.Name = "Receiver";
-------------------------------------- NULL/Boolean Variables
local LanternWeld;
local Lantern;
local Scanner;
local touching;
local PreparedSound;
local IsBeating = true;
local BreathAnim;
local in_dust_region;
local DustAnimating;
local OutUpdating;
local mouse = Player:GetMouse();
local gui = script.Parent;
local Cam = Workspace.CurrentCamera;
local cam = Workspace.CurrentCamera;
local char = Player.Character;
local Torso,Head,LL,RL,RA,LA = char.Torso,char.Head,char['Left Leg'],char['Right Leg'],char['Right Arm'],
char['Left Arm'];
local LerpCameraValue = char:FindFirstChild('TweenCam') and char:WaitForChild('TweenCam') or
Instance_new('ObjectValue',char);
LerpCameraValue.Name = 'TweenCam';
if char:FindFirstChild('Sound') then char.Sound.Disabled = true end
local Is_Adjusting = false;
local human,torso,head = char:WaitForChild("Humanoid"),char:WaitForChild("Torso"),char:WaitForChild("Head");
local face = head.face;
local LA = char["Left Arm"];
local rl = char['Right Leg'];
for _,v in pairs(Storage.CharacterSounds:GetChildren()) do
ContentProvider:Preload(v.SoundId);
v:Clone().Parent = head;
end
----------------------------------------------- String Variables
local Extent_Slow_1 = .7; --.5,.7
local Extent_Slow_2 = .9;
local Extent_Fast_1 = .17;
local Extent_Fast_2 = .37;
local Wait_For_Beat_1 = Extent_Slow_1;
local Wait_For_Beat_2 = Extent_Slow_2;
local pat = "(.-)%s"
local status = "normal";
local playtimes = {
["Breathe"] = 11.5,
["Scared1"] = 11,
["Scared2"] = 14.5,
["Scared3"] = 10,
["Terrified1"] = 14,
["Terrified2"] = 14,
["Terrified3"] = 10
}
local statuses = {
["normal"] = {"Breathe"},
["scared"] = {"Scared1","Scared2","Scared3"},
["terrified"] = {"Terrified1","Terrified2","Terrified3"}
}
local soundbase = {
['Terrain_Grass'] = {'http://www.roblox.com/asset/?id=131620285',1,.25},
['Terrain_Wood'] = {'http://www.roblox.com/asset/?id=131245773',1,.25},
['Terrain_Tile'] = {'http://www.roblox.com/asset/?id=131245773',1,.25},
['Terrain_Carpet'] = {'http://www.roblox.com/asset/?id=16720281',1,.25},
['Terrain_Metal'] = {'http://www.roblox.com/asset/?id=11450310',1,1}
}
local Notes = {
[=["The boy began to hallucinate. The winds blew heavily and numbed his body with its icy touch. He grasped his lantern firmly as his mind failed to keep up with the beat of his heart."]=]
}
local SoundDatabase = {
["eat"] = 'http://roblox.com/asset?id=64447011 .4-.',
["inn"] = 'http://www.roblox.com/asset/?id=27697267 1-.',
["dog"] = 'http://roblox.com/asset?id=131719533 .8-.85-.9-.95-1-.',
["fire"] = 'http://www.roblox.com/asset/?id=31760113 .75-.8-.85-.',
["cricket"] = 'http://www.roblox.com/Asset?ID=86300687 .3-.35-.4-.45-.5-.55-.',
["chirp1"] = 'rbxasset://sounds/uuhhh.wav 9.5-.-10-.',
["darkforest"] = 'http://www.roblox.com/Asset?ID=86300687 .1-.',
["ogre"] = 'rbxasset://sounds/uuhhh.wav .15-.2-.25-.3-.',
["choir"] = 'http://www.roblox.com/asset/?id=1372258 .7-.-.75-.8',
["fightmusic"] = 'http://www.roblox.com/asset?id=58479849 .7-.',
["thememusic"] = 'http://www.roblox.com/asset/?id=5985787 1-.',
["tuba"] = 'http://www.roblox.com/asset/?id=47697530 1-.',
["flute"] = 'http://www.roblox.com/asset/?id=52155103 .6-.65-.7-.75-.8-.',
["crow"] = 'http://www.roblox.com/asset/?id=131682192 .9-.95-1-.'
}
local ids = {
"http://roblox.com/asset?id=131063871",
"http://roblox.com/asset?id=130976109",
"http://roblox.com/asset?id=131489490",
"http://roblox.com/asset?id=131489497",
'http://www.roblox.com/asset/?id=131620285',
'http://www.roblox.com/asset/?id=131245773',
"http://www.roblox.com/asset/?id=11450310",
"http://roblox.com/asset?id=131671747",
"http://roblox.com/asset?id=130783038",
'http://roblox.com/asset?id=64447011',
'http://www.roblox.com/asset/?id=27697267 ',
'http://roblox.com/asset?id=131719533 ',
'http://www.roblox.com/asset/?id=31760113 ',
'http://www.roblox.com/Asset?ID=86300687 ',
'rbxasset://sounds/uuhhh.wav ',
'http://www.roblox.com/Asset?ID=86300687 ' ,
'rbxasset://sounds/uuhhh.wav ',
'http://www.roblox.com/asset/?id=1372258 ',
'http://www.roblox.com/asset?id=58479849 ',
'http://www.roblox.com/asset/?id=5985787 ',
'http://www.roblox.com/asset/?id=47697530 ',
'http://www.roblox.com/asset/?id=52155103 ',
'http://www.roblox.com/asset/?id=131682192 '
}
local scrgui = script:WaitForChild("ScreenGui");
local forest = script:WaitForChild("Forest");
local Unsettling = script:WaitForChild("Unsettling");
game.ContentProvider:Preload(forest.SoundId);
wait()
forest:Play();
local note = scrgui:WaitForChild('Note');
local function Calm()
status = status == "terrified" and "scared" or "normal";
end
local function TweenVolumeIn(soundsource)
coroutine_resume(coroutine_create(function()
local vol = soundsource.Volume;
for i = vol,0.5,0.0025 do
soundsource.Volume = i;
sleep(0,0.03);
end
end))
end
local function TweenVolumeOut(soundsource)
coroutine_resume(coroutine_create(function()
local vol = soundsource.Volume;
for i = vol,0,-0.0025 do
soundsource.Volume = i;
sleep(0,0.03);
end
for i = 1, 3 do soundsource:Stop(); end
soundsource.Volume = vol;
end))
end
function addids(tab)
for _,v in pairs(tab) do
if type(v) ~= 'table' then
ids[#ids+1] = v:match("(.-)%s+") and v:match("(.-)%s+") or '';
elseif type(v) == 'table' then
addids(v)
end
end
end
addids(SoundDatabase)
local function CreateFake(...)
local args = {...}
for _,p in pairs(args) do
local clone = p:Clone();
clone.Parent = Cam;
clone.Name = 'Fake'..p.Name;
clone.CFrame = p.CFrame;
local w = Instance.new('Weld',Cam);
w.Name = "Weld"..p.Name
w.Part0 = p;
w.Part1 = clone;
if w.Name:match("Leg") or w.Name:match("Torso") then
w.C0 = w.C0 * CFrame.new(0,0,1)
end
end
end
CreateFake(RA,LA,RL,LL,Torso)
------------------------------------------------ Integer variables
local pitch = .7;
local vol = .3;
local O_W_S = '7';
local I_W_S = '12';
local Speed_Render = O_S_R;
local laststep = 0;
local maxchance = 3;
local randombrightness = {1,5};
----------------------------------------------- Instancing variables
local Sound = Instance_new('Sound',gui);
Sound.Volume = .3;
Sound.Name = Player.Name..' Sound Animation';
local Last_Part = Workspace:WaitForChild("Terrain_Grass");
--------------------------------------------------MAIN FUNCTIONS
-- UI related functions
local function ChangeText(txt,duration)
note.Visible = true;
note.Text = txt;
for i = 1.1,-0.1,-.05 do note.TextTransparency = i sleep(0,0.03) end
wait(duration+(#txt:gsub("%s+","")/25));
for i = 0,1.1,.05 do note.TextTransparency = i sleep(0,0.03) end
note.Visible = false;
end
-- Preload Sounds
for i = 1,#ids do sleep(0,0.1)
ContentProvider:Preload(ids[i]);
end
LoadingStop = nil
human.WalkSpeed = O_W_S;
-- World Space UI
-- General atmosphere
local UnsettleData = {
{"http://roblox.com/asset?id=131063871",.8},
{"http://roblox.com/asset?id=130976109",.6},
{"http://roblox.com/asset?id=131489490",.8},
{"http://roblox.com/asset?id=131489497",.8}
}
local function Unsettle()
Unsettling.SoundId,Unsettling.Pitch =
unpack(UnsettleData[math_random(1,4)]);
wait(.1)
Unsettling:Play();
end
local function Weld(Model)
for i,v in pairs(Model:GetChildren()) do
if v:IsA("BasePart") then
if Last then
local w = Instance_new("Weld",Last)
w.Part0 = Last
w.Part1 = v
w.C0 = CFrame_new()
w.C1 = v.CFrame:inverse() *Last.CFrame
end
local Parts = Model:GetChildren()
local Part = Parts[math.random(1,#Parts)]
if Part:IsA("BasePart") then
local w = Instance_new("Weld",Part)
w.Part0 = Part
w.Part1 = v
w.C0 = CFrame_new()
w.C1 = v.CFrame:inverse() *Part.CFrame
end
Last = v
elseif v:IsA("Model") then
Weld(v)
end
end
end
local function UnAnchor(Model)
for i,v in pairs(Model:GetChildren()) do
if v:IsA("BasePart") then
v.Anchored = false
elseif v:IsA("Model") then
UnAnchor(v)
end
end
end
local function DestroyLantern()
if LanternWeld then LanternWeld:Destroy();end
if Lantern then Lantern:Destroy(); end
end
local function GiveLantern()
Lamp = Storage.Lantern:Clone()
Lamp.Parent = Workspace;
Weld(Lamp)
UnAnchor(Lamp)
LanternWeld = Instance_new("Weld",torso)
LanternWeld.Part0 = torso
LanternWeld.Part1 = LA
LanternWeld.C0 = CFrame_new(-1.15,0.9,-0.6) *CFrame.Angles(math_rad(90),math_rad(-90),0)
local W = Instance_new("Weld",LA)
W.Part0 = LA
W.Part1 = Lamp.Handle
W.C0 = CFrame_new(0,-1,0)*CFrame.Angles(0,math_rad(90),0) *CFrame.Angles(math_rad(-90),0,0)
Lamp.Name = 'Lantern'..Player.Name;
Lantern = Lamp;
Light = Lantern.Light.PointLight;
coroutine.resume(coroutine.create(function()
local count = 0;
local countb = 0;
local randomcount = 300
while sleep(0,0.1) do
count = count + 1;
countb = countb + 1;
if count >= 200 then
Calm() count = 0;
elseif countb >= randomcount then
Unsettle(); countb = 0; randomcount = math_random(200,700);
end
Light.Range = math_random(12,14)
end
end))
end
function Check_Breath(var1,var2)
if not PlayerGui:FindFirstChild('Breath_Anim') then return end;
local Breath = PlayerGui:FindFirstChild('Breath_Anim')
Breath:FindFirstChild('1').Value,Breath:FindFirstChild('2').Value = var1,var2;
end
function Beat_Adjust() Is_Adjusting = true;
while Is_Adjusting == true do sleep(0,0.1)
if torso.Velocity.Magnitude > 8 then
Check_Breath(.1,.1)
Wait_For_Beat_1 = Wait_For_Beat_1 > Extent_Fast_1 and Wait_For_Beat_1 - 0.005 or Wait_For_Beat_1;
Wait_For_Beat_2 = Wait_For_Beat_2 > Extent_Fast_2 and Wait_For_Beat_2 - 0.005 or Wait_For_Beat_2;
elseif torso.Velocity.Magnitude < 1 then
Wait_For_Beat_1 = Wait_For_Beat_1 < Extent_Slow_1 and Wait_For_Beat_1 + 0.001 or Wait_For_Beat_1;
Wait_For_Beat_2 = Wait_For_Beat_2 < Extent_Slow_2 and Wait_For_Beat_2 + 0.001 or Wait_For_Beat_2;
if Wait_For_Beat_1 == Extent_Slow_1 then
Check_Breath(5,8)
Is_Adjusting = false;
end
end
end
end
--- Character related functions
local GetUnder = function()
local underray = Ray_new(torso.Position,Vector3_new(0,-5,0));
local under,pos = Workspace:FindPartOnRayWithIgnoreList(underray,{char,Workspace.Regional})
if under and soundbase[under.Name] then
FootStep = under.Name;
return true
else
return true
end
end
function Breath_Anim()
coroutine_resume(coroutine_create(function()
BreathAnim = true;
while(BreathAnim) do sleep(0,0.1)
wait(math_random(4,12));
if weld then weld:Destroy() smoke:Destroy(); Breath_Part:Destroy() end
face.Texture = Face.Talking;
local Breath_Part = head:Clone()
Breath_Part.CanCollide = false;
Breath_Part.Parent = Workspace;
Breath_Part.Transparency = 1
Breath_Part.face:Destroy()
local weld = Instance_new('Weld',Workspace)
weld.Part0 = head weld.Part1 = Breath_Part
Breath_Part.Name = 'BreathPart' weld.C0 = weld.C0 * CFrame_new(0,-.5,-1)
local smoke = AtmospherePack.Breath:Clone()
smoke.Parent = Breath_Part
wait(.5)
face.Texture = Face.Closed
end
end))
end
local function WaitForDistance(part,radius)
repeat sleep(0,0.1) until (torso.Position-part.Position).Magnitude <= radius;
end
local RegionEntrance = {
["Sound"] = function(partt)
local running = true;
local pos = torso.Position;
local quitest,name,closest = 0,partt.Name,10000000
local freq = 0;
local fr1,fr2 = nil, nil;
local firebright,firerange = nil,nil;
local a, b, c, d, e,f,g,h,i,j,k =
name:match("^(.-)|(.-)|(.-)|(.-)|(.-)|(.-)|(.-)|(.-)|(.-)|(.-)|(.-)|?");
if i == 'day' and Day.Value == false or
i == 'night' and Day.Value == true then
return
end
local light = partt:FindFirstChild("Fire") and waitfor(partt.Fire.Value,'PointLight') or
Instance_new('PointLight');
local anim = partt:FindFirstChild('Animation') and partt.Animation.Value or Instance_new('Part');
firebright,firerange = light.Brightness,light.Range;
fr1 = firerange;
fr2 = firerange + 2;
if partt:FindFirstChild("Chicken") then
local ChickenModel = partt.Chicken.Value;
ChickenAnimating.Value = ChickenModel
Chicken_Sounds = true;
coroutine.resume(coroutine.create(function()RunChickenSounds()end))
end
if gui:FindFirstChild(d) then return end
local loudest,Radius,frequency,distancestop = tonumber(e),tonumber(f),tonumber(g),tonumber(h);
local s = Instance_new("Sound",gui); s.Name = d;
s.Volume = -1;
local id = SoundDatabase[d:lower()]:lower()
local pitch_data = {};
local remainder = id:gsub(pat,"");
for w in remainder:gmatch("(%.?.-)%-") do
table_insert(pitch_data,tonumber(w));
end
local function setfrequency()
local randompitch = pitch_data[math_random(1,#pitch_data)]
local delimiter = math_min(unpack(pitch_data));
local increase = 0;
for index,value in pairs(pitch_data) do
increase = index > 1 and increase + .5 or 0;
if value == randompitch then
return frequency+increase;
end
end
end
s.SoundId = id:match(pat);
s.Volume = 0;
s.Pitch = pitch_data[math_random(1,#pitch_data)];
freq = setfrequency();
wait(.5)
s:Play();
AnimFire.Value = anim;
local clopart = nil;
local part, hitpoint =
Workspace:FindPartOnRay(Ray_new(pos, CFrame_new(pos, partt.Position).lookVector * (pos - partt.Position).magnitude),char)
coroutine_resume(coroutine_create(function()
while(running) do sleep(0,freq);
s.Pitch = pitch_data[math_random(1,#pitch_data)];
freq = setfrequency();
AnimFire.Value = nil;
wait()
AnimFire.Value = anim;
s:Play();
end
end))
while(running) do sleep(0,0.05)
--light.Brightness = randombrightness[math_random(1,#randombrightness)]
light.Range = math_random(fr1,fr2);
local pos = torso.Position
local dist = (pos - partt.Position).magnitude
if dist < closest then
clopart = partt
closest = dist
end
if partt then
local percentile = (dist/Radius) - .3
if Radius - dist < distancestop then
Chicken_Sounds = nil
s:Stop()
wait()
s:Destroy()
light.Brightness = randombrightness[math_random(1,#randombrightness)]
light.Range = math_random(23,25);
running = false;
else
s.Volume = 1-percentile >= loudest and s.Volume or 1-percentile;
end
end
end
end,
["RandomEvent"] = function(partt)
local name = partt.Name;
local a, b, c, d, e,f,g,h,i,j,k =
name:match("^(.-)|(.-)|(.-)|(.-)|(.-)|(.-)|(.-)|(.-)|(.-)|(.-)|(.-)|?");
local perpetrator = loadstring([=[return ]=]..d)();
if perpetrator == nil then return end
local chance,radius = tonumber(g),tonumber(f);
if (math_random(chance,maxchance)) ~= chance then return end
WaitForDistance(partt,radius);
print(perpetrator);
PlayDialog(radius,c,perpetrator);
end,
["DustAnimation"] = function(partt)
if DustAnimating then return end;
DustAnimating = true;
local name = partt.Name;
local a,b,c,d,e,f,g,h,i,j,k =
name:match("(.-)|(.-)|(.-)|(.-)|(.-)|(.-)|(.-)|(.-)|(.-)|(.-)|(.-)|");
local p,partcount,x,xx,y,yy,z,zz = loadstring('return '..d)(),tonumber(e),
tonumber(f),tonumber(g),tonumber(h),tonumber(i),tonumber(j),tonumber(k);
in_dust_region = true
local centerpoint = p.Position;
local Power = 100;
local MaxPower = Power;
local parts = {};
for i = 1, partcount do
local newpart = Dust:clone()
newpart.Position = centerpoint
newpart.Anchored = false;
newpart.Parent = Workspace;
newpart.Name = 'NewDust'
DustFloat:Clone().Parent = newpart;
DustFloat.P = Power;
parts[#parts+1] = newpart;
end
while(in_dust_region) do
for _,v in pairs(parts) do
bf = v.DustFloat;
bf.P = Power;
bf.position = centerpoint +
Vector3_new(math_random(x,xx),math_random(y,yy),math_random(z,zz));
end
wait(1)
Power = 10;
end
for _,v in pairs(parts) do
v:Destroy()
end
DustAnimating = nil;
end
}
local function WalkPlay()
if Is_Adjusting == false then coroutine.resume(coroutine.create(Beat_Adjust)) end
WalkPlaying = true;
Walking = true;
while Walking do
if not GetUnder() then print('Falling') WalkPlaying = nil Walking = nil return end
GetUnder();
local speed = torso.Velocity.magnitude;
local waittime = 3/speed;
if speed < 1 then Walking = nil WalkPlaying = nil print'Idle' return end
local tab = soundbase[FootStep];
if not tab then Walking = nil WalkPlaying = nil return end
local id,pitch,vol = unpack(tab);
Sound.SoundId,Sound.Pitch,Sound.Volume = id,pitch,vol;
Sound:Play();
wait(waittime);
end
WalkPlaying = nil
end
-- Camera related functions
local function IsVisible(point,cf,ratio)
if cf.lookVector:Dot((point-cf.p).unit) > 0 then
local r = cf:toObjectSpace(CFrame.new(point))
local q = -1/r.z
local p = Vector3.new(r.x*q,r.y*q,-1)
local y = 0.577
local x = ratio*y
if p.x >
-x
and p.x < x
and p.y > -y
and p.y < y then
return true
end
end
return false
end
local function Scope(man)
Scoping = true;
local head = man:WaitForChild("Head");
local oldstatus = status;
while Scoping do sleep(0,0.03)
if IsVisible(head.Position,cam.CoordinateFrame,3.5) == true then
status = oldstatus == "normal" and "scared" or "terrified"
end
end
end
local function LerpCamera(Part1, Part2)
local charfacing = Part2.Parent;
local charfacingtorso = charfacing:WaitForChild("Torso");
Brick.CFrame = CFrame_new(Brick.Position,brickToFace.Position)
Chatting = true
cam.CameraType="Scriptable"
local camPart=Instance_new("Part", game.Workspace)
camPart.Name, camPart.Anchored, camPart.Transparency,camPart.CanCollide="StartPart", true, 1,false
camPart.CFrame= CFrame_new(Part1.Position + (Part1.CFrame.lookVector * 2))
local dist=(camPart.Position-Part2.Position).magnitude
for i=0.5, dist, 0.5 do
local pos=camPart.Position:Lerp(Part2.Position, i/dist)
cam.CoordinateFrame=CFrame_new(camPart.Position, pos)
Wait(0.03)
end
game.Debris:AddItem(camPart,1)
end
LerpCameraValue.Changed:connect(function()
if LerpCameraValue.Value ~= nil then
LerpCamera(head,LerpCameraValue.Value)
end
end)
--------------------------------------------------------- EVENT HANDLING
local walking = human.Running:connect(function()
print("Run");
if WalkPlaying then return end
WalkPlay();
end)
local key_down = mouse.KeyDown:connect(function(key)
local time = 100;
if key == "\48" and frozen == false and torso.Velocity.magnitude > 5 then
IsSprinting = true;
human.WalkSpeed = I_W_S;
repeat wait(.1) time = time - 1;
until IsSprinting == false or time <=0
human.WalkSpeed = O_W_S
end
end)
local key_up = mouse.KeyUp:connect(function(key)
if key == "\48" and frozen == false then
IsSprinting = false
end
end)
local scanner = Torso.Touched:connect(function(hit)
local UpdateOut;
if touching or frozen == true then return end
touching = true
local passed = hit.Name;
print(passed);
if(passed:match(".+|.+|(%w+)|.+|.+|.+|.+|.+|.+|.+|.+|?")) then
local passmatch = passed:match(".+|.+|(.+)|.+|.+|.+|.+|.+|.+|.+|.+|?");
coroutine_resume(coroutine_create(function()
RegionEntrance[passmatch](hit)
end))
elseif passed:match('Note/.+') then
local notee = passed:match('.-/(.+)');
ChangeText(notee);
end
touching = false;
end)
local receiverchanged = Receiver.Changed:connect(function()
if Receiver.Value == true then
local Man = Workspace:FindFirstChild("Man");
if not Man then return end
Scope(Man);
else
Scoping = nil;
end
end)
coroutine.resume(coroutine.create(function()
wait(1)
ChangeText(Notes[1],12);
StatusPlaying = true;
while StatusPlaying do
if playing then playing:Stop(); end
local laststatus = status;
local tab = statuses[status]; if tab == nil then return end
local sound = tab[math_random(1,#tab)];
local playtime = playtimes[sound];
local soundobject = head[sound];
playing = soundobject;
playing:Play();
local count = 0;
repeat wait(1) count = count + 1
until count >= playtime or status ~= laststatus;
if status == "scared" and laststatus == "normal" then
Wait_For_Beat_1 = Extent_Fast_1;
Wait_For_Beat_2 = Extent_Fast_2;
elseif status == "normal" and laststatus ~= "normal" then
Wait_For_Beat_1 = Extent_Slow_1;
Wait_For_Beat_2 = Extent_Slow_2;
end
end
end))
GiveLantern();
Player.Chatted:connect(function(msg)
if msg:match(".-/.+") then
local statuss = msg:match(".-/(.+)")
if statuses[statuss:lower()] then status = statuss:lower() end
end
end)
local count = 0;
while IsBeating do
Beat.Pitch = .05
Beat:Play()
wait(Wait_For_Beat_1)
Beat.Pitch = .1
Beat:Play()
wait(Wait_For_Beat_2)
end |