OKKKKKKKK
So now With help i’ve been able to fix everything except for the damage part of the flamethrower.
The server script trying to recieve it: (server)
local storage = game.ReplicatedStorage
local event = storage.Cooler
local function onActivation()
print('omg this is working')
script.Parent.Touched:Connect(function(hit)
local humanoid = hit.Parent:FindFirstChildWhichIsA("Humanoid")
if humanoid then
humanoid:TakeDamage(3)
end
end)
end
event.OnServerEvent:Connect(onActivation)
First of all, you should never reference items inside server scripts and module scripts.
Second of all, is the server script inside the ServerScriptService?
local storage = game:WaitForChild('ReplicatedStorage')
local event = storage:WaitForChild('Cooler')
local function onActivation()
print('omg this is working')
script.Parent.Touched:Connect(function(hit)
local humanoid = hit.Parent:WaitForChildWhichIsA("Humanoid")
if humanoid then
humanoid:TakeDamage(3)
end
end)
end
event.OnServerEvent:Connect(onActivation)
This is incorrect. Unless the object has to be created by another script during runtime, server scripts don’t need to use :WaitForChild(). Only LocalScripts would need to use them in this situation.
When making a ColorSequence with more than two colors, you need to create a table of ColorSequenceKeypoints and create a ColorSequence with that table. See here
I just tool out the part that defined the particle’s rate and the particles show up, everything works except for the damage when i take away the rate definer
And the print statement doesnt work also so the remote events dont work
Edit: nvm ur right the colorsequence is only playing 2 colors
Sometimes the server tries to define variables that aren’t there, so wouldn’t the server need to use WaitForChild to make sure the script hasn’t loaded before the objects? I’ve second guessed myself now lol
Edit: it took me a second for my brain to click but yes i am wrong
Either way, your ColorSequence isn’t exactly how you want it to be. What your constructor actually makes is a ColorSequence with only two colors. The first and second in the arguments you passed.