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

How do i fix the owner part of my script?

so i have been messing around with scripts but this is the part i cant figure out for some reason. any help can and will be appreciated


game.Players.PlayerAdded:Connect(function(player) --playr joins 	player.CharacterAdded:Connect(function(char)
		local adminlist = {
			123010855, -- me
			1, -- someone else
			2, -- someone else
 			3, -- someone else
		}
		local HRP = char:WaitForChild("HumanoidRootPart")
		local marble = Instance.new("Part")
		marble.Size = Vector3.new(8,8,8) --marbl make
		if player.UserId == adminlist then
			marble.BrickColor = BrickColor.Cyan
			marble.Transparency = 0
			marble.Shape = Enum.PartType.Ball
 			marble.Material = Enum.Material.ForceField
 		else
 		marble.BrickColor = BrickColor.Random()
 		marble.Transparency = .5
 		marble.Shape = Enum.PartType.Ball
 		marble.Parent = char
 		marble.Material = Enum.Material.SmoothPlastic -- mm plastic for turtl
 		local Velocity = Instance.new("BodyAngularVelocity")
 		Velocity.Parent = marble
 		local Hum = char:WaitForChild("Humanoid")
 		local Weld = Instance.new("Weld") -- locks the marbl to playe
 		Weld.Parent = marble
 		Weld.Part0 = HRP
 		Weld.Part1 = marble
 		Hum.PlatformStand = true
 
 		while true do
 			wait()
 			marble.BodyAngularVelocity.AngularVelocity = vector3.new(char.Humanoid.MoveDirection.z * 32,0,char.Humanoid.MoveDirection.x * -32)
			marble.BodyAngularVelocity.MaxTorque = Vector3.new(30000,30000,30000)
 			if char.Humanoid.MoveDirection == Vector3.new(0,0,0) then -- moving stuffs
			marble.BodyAngularVelocity.MaxTorque = Vector3.new(0,0,0)
 				end
 			end
 		end
 	end)
 end)
 -- mad by ron shark

2 comments

1

U didn't make this script! Scripting helpers aren't suppose to fix free model scripts!

0

i did, just because i need help with a maybe easy part doesnt mean it isnt my script

1 answer

Without any hint as to what is going on here, I am going to go out on a whim and say your problem lies here: if player.UserId == adminlist then. You are trying to compare an int64 (the user ID) and a table (the admin list), which will ALWAYS return false due to them being different types (there's more to it than that, but good enough for here). To fix this, one solution is to use table.find(table, element) like so: if table.find(adminlist, player.UserID) then

This will return the index of the element if the element is found, and nil if not.

2 comments

0

thanks but it still doesnt work

0

It would be a great help if you could provide more information than "it doesn't work". There is literally nothing I can do unless you tell me what exactly doesn't work. The same applies for the main post, you did not specify at all what is wrong. Either specify what's wrong or don't expect any help.

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