When I was testing a transformation code (Using Z to transform with remote events & Toolbox Localscripts, with an execution script in the workspace) I came across a large issue. When I used "OnServerEvent", it said "OnServerEvent" is not a valid member of script. When testing this with a fireball using similar if not the exact same script, minus casting time and cooldown, it worked.
Player = game.Players.LocalPlayer
Transforming = false
Transformed = false
game.Workspace.Powerup.OnServerEvent:Connect(function(Player, Debounce)
if Transformed == true then
Player.Character.Humanoid.MaxHealth = 100
Transformed = false
else
local Character = Player.Character or Player.CharacterAdded:wait()
Transforming = true
local Aura = Instance.new("Part", Player.Character.UpperTorso)
Aura.Transparency = 1
Aura.Anchored = true
local Aurafire = Instance.new("ParticleEmitter", Aura)
Aurafire.Texture = ("rbxassetid://242102147")
Aurafire.Color = BrickColor.new("Black")
wait(5)
Player.Character.Humanoid.MaxHealth = 200
Transforming = false
Transformed = true
end
end)

4 comments
is this from the client and is Powerup a remote event
Powerup is a remote event
And what do you mean by the client? Sorry i'm new to the coding game.
Just looked it up, and I think it's being run on the server, because the server is producing these object (Particles and stuff) for the client who fired the event. If it were just on the client I think it would only be visible to the Client.