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)
You need tp put local char = Player.Character After your first line otherwise it wont know where to find the added character