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
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.