Greetings! I’m making a karting game, and just like Mario Kart, I have made particles that should appear when a player drifts. The problem is, its not working… I have no idea what I should do.
I have a drift to boost mechanism local script that is parented to StarterCharacterScripts. I’m not gonna share the entire thing because I don’t think its important to solving this issue (its 300 lines long anyway). Here’s where I defined my particles.
Then I fired the remote event, and passed through the particles.
Please note that I also passed variables named: elapsedtime, and all the driftdurations, so that the right particles appear depending on the drift duration, or at least, that was what was intended.
I think the server-side is where the problem is. this is what I have on the server side. (its parented to serverscriptservice)
local DriftEvent = game.ReplicatedStorage:WaitForChild("DriftEffectEvent")
DriftEvent.OnServerEvent:Connect(function(LeftGreen1, LeftGreen2, LeftGreen3, LeftGreen4, RightGreen1, RightGreen2, RightGreen3, RightGreen4, LeftBlue1, LeftBlue2, LeftBlue3, LeftBlue4, RightBlue1, RightBlue2, RightBlue3, RightBlue4, LeftRed1, LeftRed2, LeftRed3, LeftRed4, RightRed1, RightRed2, RightRed3, RightRed4, DriftStartTick, DriftDuration, DriftDuration2, DriftDuration3, elapsedtime)
print("Test 1.")
print("Test 2.")
if DriftStartTick.Value ~= 0 then
print("Test 3.")
if elapsedtime >= DriftDuration.Value and elapsedtime.Value < DriftDuration2.Value then
print("Received.")
LeftGreen1.Enabled = true
LeftGreen2.Enabled = true
LeftGreen3.Enabled = true
LeftGreen4.Enabled = true
RightGreen1.Enabled = true
RightGreen2.Enabled = true
RightGreen3.Enabled = true
RightGreen4.Enabled = true
LeftBlue1.Enabled = false
LeftBlue2.Enabled = false
LeftBlue3.Enabled = false
LeftBlue4.Enabled = false
RightBlue1.Enabled = false
RightBlue2.Enabled = false
RightBlue3.Enabled = false
RightBlue4.Enabled = false
LeftRed1.Enabled = false
LeftRed2.Enabled = false
LeftRed3.Enabled = false
LeftRed4.Enabled = false
RightRed1.Enabled = false
RightRed2.Enabled = false
RightRed3.Enabled = false
RightRed4.Enabled = false
elseif elapsedtime.Value >= DriftDuration2.Value and elapsedtime < DriftDuration3.Value then
LeftBlue1.Enabled = true
LeftBlue2.Enabled = true
LeftBlue3.Enabled = true
LeftBlue4.Enabled = true
RightBlue1.Enabled = true
RightBlue2.Enabled = true
RightBlue3.Enabled = true
RightBlue4.Enabled = true
LeftGreen1.Enabled = false
LeftGreen2.Enabled = false
LeftGreen3.Enabled = false
LeftGreen4.Enabled = false
RightGreen1.Enabled = false
RightGreen2.Enabled = false
RightGreen3.Enabled = false
RightGreen4.Enabled = false
LeftRed1.Enabled = false
LeftRed2.Enabled = false
LeftRed3.Enabled = false
LeftRed4.Enabled = false
RightRed1.Enabled = false
RightRed2.Enabled = false
RightRed3.Enabled = false
RightRed4.Enabled = false
elseif elapsedtime.Value >= DriftDuration3.Value then
LeftRed1.Enabled = true
LeftRed2.Enabled = true
LeftRed3.Enabled = true
LeftRed4.Enabled = true
RightRed1.Enabled = true
RightRed2.Enabled = true
RightRed3.Enabled = true
RightRed4.Enabled = true
LeftGreen1.Enabled = false
LeftGreen2.Enabled = false
LeftGreen3.Enabled = false
LeftGreen4.Enabled = false
RightGreen1.Enabled = false
RightGreen2.Enabled = false
RightGreen3.Enabled = false
RightGreen4.Enabled = false
LeftBlue1.Enabled = false
LeftBlue2.Enabled = false
LeftBlue3.Enabled = false
LeftBlue4.Enabled = false
RightBlue1.Enabled = false
RightBlue2.Enabled = false
RightBlue3.Enabled = false
RightBlue4.Enabled = false
else
LeftGreen1.Enabled = false
LeftGreen2.Enabled = false
LeftGreen3.Enabled = false
LeftGreen4.Enabled = false
RightGreen1.Enabled = false
RightGreen2.Enabled = false
RightGreen3.Enabled = false
RightGreen4.Enabled = false
LeftBlue1.Enabled = false
LeftBlue2.Enabled = false
LeftBlue3.Enabled = false
LeftBlue4.Enabled = false
RightBlue1.Enabled = false
RightBlue2.Enabled = false
RightBlue3.Enabled = false
RightBlue4.Enabled = false
LeftRed1.Enabled = false
LeftRed2.Enabled = false
LeftRed3.Enabled = false
LeftRed4.Enabled = false
RightRed1.Enabled = false
RightRed2.Enabled = false
RightRed3.Enabled = false
RightRed4.Enabled = false
end
end
end)
According to the print statements, it doesn’t get after the print statement “test 2.” I’ve tried so many things, and I can’t figure it out. What I’ve just showed you is the last solution I’ve tried.
Please let me know if you have any questions. I would appreciate it if someone could solve my issue, and I would also appreicate if someone could tell me if I’m doing something wrong regarding posting, because this is my very first post.
Thank you!
TQ5890