I am trying to make a circle that a player can walk with like in this game:
[👟UPD 15👟] Shoe Simulator👟 - Roblox.
But I can’t figure out how to add the circle to every player.
Try utilizing weldconstraints
try having the part in a serverscript and putting the script in startercharacterscripts
ensure the circle is unanchored
local character = script.Parent
local hrp = character:WaitForChild("HumanoidRootPart")
local circle = script:WaitForChild("Circle") -- rename the parameter to whatever the circle is named
circle.Parent = hrp
circle.Position = hrp.Position-Vector3.new(0,2,0) -- mess with the y value until you get a position that is satisfactory for you
local weld = Instance.new("WeldConstraint",circle)
weld.Part0 = circle
weld.Part1 = hrp
I also recommend disabling cancollide for the circle
I have one more question… how do I make a script where when the circle touches a part, the person who’s circle touched it get +1 dollar for which in this case is +1 phone. (my currency is called “Phone”)
On the server, you’d connect a Touched event associated with the Circle created. When another part touches the circle, it runs the function passed to it. In this function, you can see if the HitPart that touched it is equal to the part you want to be affected by it. After that, you can increase your ‘Phone’ currency by one, depending on your structure of player data.
Rough example:
local Phone -- Reference to the 'Phone' currency value object.
Circle.Touched:Connect(function(HitPart)
if HitPart.Name == "Change this to the part's name" then
Phone.Value += 1 -- Increments your currency by one.
end
end)
Hopefully that helps out.
do this in the same script that you made earlier
local character = script.Parent
local hrp = character:WaitForChild("HumanoidRootPart")
local circle = script:WaitForChild("Circle") -- rename the parameter to whatever the circle is named
circle.Parent = hrp
circle.Position = hrp.Position-Vector3.new(0,2,0) -- mess with the y value until you get a position that is satisfactory for you
local weld = Instance.new("WeldConstraint",circle)
weld.Part0 = circle
weld.Part1 = hrp
local debounce -- to prevent the touched script from firing too many times
local debounceTime = 0.1 -- cooldown time
function onTouch (hit)
if not debounce and hit.Name == "name of part here" then
debounce = true
phone.Value += 1
wait(debounceTime)
debounce = false
end
end
circle.Touched:Connect(onTouch)