i would like to ask is there any reason for an int64 to happen in that code cause i cannot figure out why
PlotOwnerUserId
is a table of instances, not a user ID. Also GetChildren()
doesn’t accept any parameters.
replace
local PlotOwnerUserId = Plot:GetChildren()
with
local PlotOwnerUserId = Plot:FindFirstChild("Owner")
first, your script editor theme is absolutely horrifying
second, ‘GetChildren’ returns an array, if you want to get the owner, use :FindFirstChild()
, and i’m pretty sure owner is going to be a character, so you need to do :GetPlayerFromCharacter
instead
now thats without the error true but the parts wont destroy themself still
also i just realized this is development discussion
move this to Scripting Support
okay i’m going to ask some questions
- when exactly is ‘CashToGive’ being set? Why are you setting it and why does it need to exist in order to grant the player a plot
- why do you not store the
Owner
in an attribute? like ‘CashToGive’? - why destroy the part that gets touched?
and since you’re polish (and i unluckily happen to be too):
- kiedy dokladnie ustawiasz ‘CashToGive’? Czemu to ustawiasz i czemu musi istniec aby dac graczowi dzialke?
- dlaczego nie przechowujesz wartosci ‘Owner’ w atrybucie tak samo jak ‘CashToGive’?
- dlaczego niczczysz klocka, ktory jest dotkniety?
please do not implode me mods i am just helping this man
musisz mnie zrozumiec ze ja nie wiem co ja robie ja tylko przepisuje tutorial
Try this script (assuming that your PlotOwnerUserId is an attribute ofc)
script.Parent.Touched:Connect(function(hit : BasePart)
local cashToGive = hit:GetAttribute("CashToGive")
if cashToGive ~= nil and type(cashToGive) == "number" then
local Plot = script.Parent.Parent.Parent.Parent
if Plot == nil then warn("No plot!") return end
local PlotOwnerUserId = Plot:GetAttribute("Owner")
if PlotOwnerUserId == nil then warn("No Plot Owner User Id") return end
hit:Destroy()
local PlayerObject = game:GetService("Players"):GetPlayerByUserId(PlotOwnerUserId)
PlayerObject.leaderstats.Cash.Value += cashToGive
end
end)
Also your script theme is burning my eyes
I recently made a quick plugin for fun (that’s completely free to use) and it has 15+ ported themes from softwares like visual studio code etc, pick one you like and save your eyes from being burned
alright, i do not have plotowneruserid as an attribute i dont know why as i said in polish i only copy and pasted tutorial without knowing anything
Right, is the userid an instance or does it just not exist?
If you could can you please link the tutorial and show us more like a screenshot of your explorer so we can see what’s going on?
im really confused right now i think it is not a instance i think it is this part of tutorial https://www.youtube.com/watch?v=60Tm4qOXN-0&list=PLsbxI7NIoTtgsjWxJt34TaQd5vDwpbL3V&index=4
I just checked the tutorial and it is indeed an attribute, could you please try using the script i provided and tell me if anything changed or any new errors appeared?
is this a virus (say on skibidi)
cause if not i’m getting it
Why would it be a virus lol
(im not looking to get my main banned dawg)
on skibidi it’s not (i said it)
brat jest normalnie jak ja, gdy mialem 10 lat
to nie jest sposob na robienie gier, bedziesz tego zalowac (tak na przyszlosc ci mowie)
just listen to what the guy is telling you and you’ll fix ti
can you show some screenshots? does it also alter the script editor?
It’s mainly on script editor themes it will legit change everything that roblox allows me to change since they are pretty strict on what plugins can and can’t customize using scripts
Idk what u meant by screenshot so js enjoy the widget screenshot of the plugin
no i mean, what does studio look like with some of those
oh, i thought someone finally figured out a way to recolor the entire studio, rather than just script editor
The only way to color the entire studio would be installing a third party program to do so (which i tried doing at some point but never finished also it would be going against the TOS to modify the roblox client so)