Hello developers, currently i have a trouble where my studio instantly close without any error message box pops up.
I’ve been trying to find the source of the problem itself, the problem comes when i try to run this script:
local ServerStorage = game:GetService("ReplicatedStorage")
local TweenService = game:GetService("TweenService")
local SkinValue = 0
local Character = script.Parent.Parent
local Skin = Character:WaitForChild("Skin")
if Skin.Value == "LightWarrior" then
SkinValue = 1
end
function InstallSkinEffects()
for i,v in pairs(ServerStorage.SkinEffects:WaitForChild(SkinValue):GetChildren()) do
if v:IsA("Accessory") then
v:Clone().Parent = Character
else
v:Clone().Parent = Character:WaitForChild("HumanoidRootPart")
end
wait()
end
end
InstallSkinEffects()
local Animation = { }
-- LOAD ANIMATION
if SkinValue == 1 then
Animation["DashStart"] = Character.Humanoid:LoadAnimation(Character.HumanoidRootPart.DashStart)
end
-- SPECIALS --
-- Effect Animation Property
function LightBall(pos)
local LightBall = Instance.new("Part")
LightBall.Parent = game.Workspace
LightBall.CanCollide = false
LightBall.Anchored = true
LightBall.Position = pos
LightBall.Size = Vector3.new(2,2,2)
LightBall.Transparency = 0.1
LightBall.Shape = Enum.PartType.Ball
LightBall.Color = Color3.new(1, 0.905882, 0.537255)
LightBall.Material = Enum.Material.Neon
local TargetSize = 30
local TweenSize = TweenService:Create(LightBall, TweenInfo.new(1, Enum.EasingStyle.Exponential), {Size = Vector3.new(TargetSize,TargetSize,TargetSize)})
local TweenTransparency = TweenService:Create(LightBall,TweenInfo.new(1,Enum.EasingStyle.Exponential), {Transparency = 1})
TweenSize:Play()
TweenTransparency:Play()
task.wait(1)
LightBall:Destroy()
end
-----------------
local Humanoid = Character:WaitForChild("Humanoid")
local SpecialDebug = false
function LightSpeed()
local Sparkle = Character.HumanoidRootPart:WaitForChild("Sparkles")
local SpeedBoost = 84
local BoostTime = 10
local Cooldown = 5
if SpecialDebug ~= true then
SpecialDebug = true
Character.HumanoidRootPart.Anchored = true
Animation.DashStart:Play()
task.wait(0.27)
Character.HumanoidRootPart.Anchored = false
Humanoid.WalkSpeed = Humanoid.WalkSpeed + SpeedBoost
Sparkle.Enabled = true
Character.HumanoidRootPart.CFrame = Character.HumanoidRootPart.CFrame * CFrame.new(0,0,-20)
LightBall(Character.HumanoidRootPart.Position)
task.wait(BoostTime)
Humanoid.WalkSpeed = Humanoid.WalkSpeed - SpeedBoost
LightBall(Character.HumanoidRootPart.Position)
Sparkle.Enabled = false
task.wait(Cooldown)
SpecialDebug = false
end
end
---------------
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Remotes = {
Specials = ReplicatedStorage:WaitForChild("Specials");
}
Remotes.Specials.OnServerEvent:Connect(function(plr)
if plr.Name == Character.Name then
if SkinValue == 1 then
LightSpeed()
end
end
end)
From my current research, the problem occurs every time i call the LightSpeed() function. I tried to remove any statement from the function and nothing seems to help.
The SpecialsRemote is fired from a script inside a PlayerGUI
local UserInputService = game:GetService("UserInputService")
local Player = game.Players.LocalPlayer
local RemoteEvent = game:GetService("ReplicatedStorage"):WaitForChild("Specials")
local Button = script.Parent
local buttonColor = Button.ImageColor3
if Player.PlayerScripts:WaitForChild("isKeyboarded").Value == true then
Button.Interactable = false
Button.Visible = false
end
function Call()
RemoteEvent:FireServer()
end
function SetImageColor(color)
Button.ImageColor3 = color
end
UserInputService.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.R then
Call()
end
end)
Button.MouseButton1Up:Connect(Call)
Button.MouseEnter:Connect(function()
SetImageColor(Color3.new(1,1,1))
end)
Button.MouseLeave:Connect(function()
SetImageColor(buttonColor)
end)
I tried to research about this problem in other topics either, their solution won’t work for me.
Well, that’s all i can tell. Please help me to fix this problem.
Thank you developers!