As shown at the captures and the vid, my scripts arent working as intended, it is supposed to change the Vector3 of my model depending on how much Divine Powder or DP i have buy as you see in the vid my model just keeps appearing and disappearing.
#my scripts arent working as intended.
1 messages · Page 1 of 1 (latest)
can u please ffs dont take screenshots of code
at least it's not a photo of a screenshot of code 😨
do u mean full screenshot?
Usually people like when you type it in discord message in a code block
```lua
--paste your code in here
```
oh ok i didnt know that
local variable = 100
local function lookIthasColours()
print("hello")
end
lookithasColours()
itll look like this
Ill take a look at the code aswell while im here
okok ty for all the info
** You are now Level 1! **
are you getting any errors when you press F9? im assuming it will say WaitForChild is waiting indefinitely
while in game*
okay then please put in some prints for me
in DPConcentration:
after local = model
print(model and "model exist")
after OnClientEvent
print(newPos)
in DPConcentrationBuilding:
after remoteEvent =
print("Remote event loaded")
after userDP =
print(userDP)
in function checkTP, before firing client
print("firing client with", position)
then just run the game and see what gets printed in F9
keep in mind its different for server and client so
does the model exist on the server workspace aswell?
of course
Did you try just changing that one instead of changing locally?
so itll replicate over i was thinking. Doesnt work if every player is in the same area tho
im slow atm cus making dinner
ok dw
ok idk if i understood that so
do u mean changing the Model pivot in the server-side?
I did
but yeah anytime a part or building gets changed on the server, that happens for everyone else also.
What you could do instead is:
make the building only on the player's side, and not on the servers side.
you could achieve this with just doing model = what it is now, but adding :Clone()
so you just keep track of that clone client side and use it for anything you need. That should make the server leave it alone. How it will affect the rest of the scripts depends on how you use the building tho
I am unsure ofc as im not that experienced with pivots and models
but i think we can figure this out eventually anyways 👍
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local replicatedStorage = game:GetService("ReplicatedStorage")
local template = ReplicatedStorage:WaitForChild("Buildings"):WaitForChild("DivineConcentrationBuilding")
local localModel = template:Clone()
localModel.Parent = workspace
localModel.PrimaryPart = localModel:WaitForChild("DivineConcentration")
local userDp = player:WaitForChild("CurrenciesFolder"):WaitForChild("DivinePowder")
function buildingPosition()
if userDp.Value >= 10000 then
localModel:SetPrimaryPartCFrame(CFrame.new(-37.828, 11.66, 29.348) * CFrame.Angles(0, math.rad(90), 0))
else
localModel:SetPrimaryPartCFrame(CFrame.new(-37.828, -10000, 29.348) * CFrame.Angles(0, math.rad(90), 0))
end
end
userDp.Changed:Connect(buildingPosition)
task.spawn(buildingPosition)
i made that
lmao why do it look like that
it works, the only problem is that the model looks like this in workspace
without gui lol
OH NVM
** You are now Level 2! **
i know why lol
so it work? :0
ah love to hear it!
remember to mark this as solved!