Speed Troll Developer Product doesnt work

If I buy the slow/freeze/fling product, so everywhere, where “JumpPower” or “WalkSpeed” is, doesnt work. The strange thing is, health works. Here is the script:

	if isPurchased == true then
		local plr = players:GetPlayerByUserId(userId)
		local chosenPlr = players:FindFirstChild(plr.PlayerGui.MainGui.SpectateMain.PlayerName.PlayerName.Text)

		if chosenPlr then
			if productId == ids.explode then
				local explosion = Instance.new("Explosion", chosenPlr.Character.UpperTorso)
				explosion.Position = explosion.Parent.Position
				chosenPlr.Character.Humanoid.Health = 0
			end
			
			if productId == ids.fling then
				chosenPlr.Character.Humanoid.Sit = true
				chosenPlr.Character.Humanoid.JumpPower = 0
				local BodyVelocity = Instance.new("BodyVelocity", chosenPlr.Character.HumanoidRootPart)
				BodyVelocity.Velocity = Vector3.new(0,200,0)
				wait(1)
				BodyVelocity:Destroy()
				wait(9)
				chosenPlr.Character.Humanoid.JumpPower = 50
			end
			
			if productId == ids.slow then
				chosenPlr.Character:FindFirstChild("Humanoid").WalkSpeed = 6
			end
			
			if productId == ids.freeze then
				chosenPlr.Character.Humanoid.WalkSpeed = 0
				chosenPlr.Character.Humanoid.JumpPower = 0
			end
			
			if productId == ids.burn then
				local fire = Instance.new("Fire", chosenPlr.Character.UpperTorso)
				
				spawn(function()
					while wait(.2) do
						chosenPlr.Character.Humanoid.Health -= 2
					end
				end)
			end
			
			if productId == ids.kick then
				chosenPlr:Kick("[TROLL]: You were kicked by", plr.Name, "!")
			end
		else
			warn("Error:", chosenPlr)
		end
	end
end)```

Only two things I can think of is that your id is written incorrectly or this code is in a local script.

Are you using PromptProductPurchaseFinished?

Don’t use PromptProductPurchaseFinished to handle developer product purchases. Use MarketplaceService.ProcessReceipt - it also might fix your issue.

If I print the walkspeed after buying, it printed and it is in a server

Yes, I tried that too. It still does’nt work

image

image

Okay, I found the solution, tysm! I made another script, that says, everytime the walk speed changes, it resets, this was the problem

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.