Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why is my keybind magic fling script not working on other models?

I have this script here when you 'press e' it's supposed to fling the other person but all it does is fling me. Any help with changing it so it flings the other models instead of flinging me

game.Players.LocalPlayer:GetMouse().KeyDown:Connect(function(key)
	if key == "e" then
		local char=script.Parent
		local humanoid=char.Humanoid
		local torso=char.HumanoidRootPart
		--------------
		--------------
		wait()

		humanoid.PlatformStand=true
		torso.CFrame=torso.CFrame*CFrame.new(0,0.2,0)*CFrame.Angles(-.5,0,math.random(0,0))
		torso.Velocity=torso.CFrame.lookVector*-100
		wait(1)
		humanoid.PlatformStand=false

		wait()
	end
end)

1 comment

0

Idk what else to do, but maybe anchor the flinger's character for that one second? Don't anchor the other person of course.

1 answer

✓ Accepted answer

You located yourself as the flinger. Consider changing line 3: local char = game.Workspace:WaitForChild("PlayerName")

This discussion is preserved as it was. New answers, comments, and votes are closed.