#my scripts arent working as intended.

1 messages · Page 1 of 1 (latest)

lean adder
#

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.

twilit gyro
noble thorn
lean adder
grave ruin
#

```lua
--paste your code in here

```

lean adder
#

oh ok i didnt know that

grave ruin
#
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

lean adder
#

okok ty for all the info

twilit parrotBOT
#

studio** You are now Level 1! **studio

grave ruin
#

while in game*

lean adder
#

uhm nop

#

idk what is causing this lmao

grave ruin
#

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)

grave ruin
#

keep in mind its different for server and client so

lean adder
#

ok ill try it

#

got this

grave ruin
#

does the model exist on the server workspace aswell?

lean adder
#

of course

grave ruin
#

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

lean adder
#

well

#

im gonna try it

grave ruin
#

im slow atm cus making dinner

lean adder
#

ok dw

#

ok idk if i understood that so

#

do u mean changing the Model pivot in the server-side?

grave ruin
#

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

lean adder
#

ok i think i can do it

#

tysm

grave ruin
#

I am unsure ofc as im not that experienced with pivots and models
but i think we can figure this out eventually anyways 👍

lean adder
#
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

twilit parrotBOT
#

studio** You are now Level 2! **studio

lean adder
#

i know why lol

grave ruin
lean adder
#

yeah! it finally works

#

tysm

grave ruin