I am working on a script that heals the player if he has enough points, when I call the remote event it only sends my user name twice instead of the price. Here is my script:
if Action.Name == "Medkit" then local Player = game.Players.LocalPlayer local character = Player.Character or Player.CharacterAdded:Wait() local humanoid = character:WaitForChild("Humanoid") local health = humanoid.Health local maxHealth = humanoid.MaxHealth local price = (maxHealth-health)*5 if Mag <= Action.Range.Value and cash.Value >= price and health > 0 then Action.Event:FireServer(Player,price) break
When I say print(Player), print(price) the output shows Channy97, Channy97
Any ideas on how to fix this? Thank you.
I figured it out. When firing a remote event the player is automatically sent as a parameter. So Action.Event:FireServer(price) needs to be sent instead of Action.Event:FireServer(Player,price)
i.e: Remove "Player"