Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do i fix the owner part of my script?

Asked by 2 years ago

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
1
U didn't make this script! Scripting helpers aren't suppose to fix free model scripts! blue_bunny0fficl 98 — 2y
0
i did, just because i need help with a maybe easy part doesnt mean it isnt my script ropi234 0 — 2y

1 answer

Log in to vote
0
Answered by
0x5y 105
2 years ago

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.

0
thanks but it still doesnt work ropi234 0 — 2y
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. 0x5y 105 — 2y
Ad

Answer this question