Kanglim12
(Capybara)
March 6, 2023, 10:37am
#1
Hi devs! I have a question How to make local model or local npc
Like that script, can i make local model or npc?
script.Parent.Touched:Connect(function(hit)
local player = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)
if player then
local plr = game.Players.LocalPlayer
if (player and player == plr) then
script.Parent.Transparency = 1
end
end
end)
(End of the code)
What do you specifically mean by “local model” ?
Kanglim12
(Capybara)
March 6, 2023, 10:46am
#3
I mean the model that only local player can see
Yes you can make using LocalScript.
If you have seen a door that unlocks for specific person for example, it basically uses LocalScript.
Kanglim12
(Capybara)
March 6, 2023, 10:48am
#5
like adding a local script in starterplayerscripts?
If it’s a script inside NPC, then it should be inside NPC, and if a script inside player, then inside StarterPlayerScripts ofcourse.
If it helps you, don’t forget to mark as a solution!
1 Like
Kanglim12
(Capybara)
March 6, 2023, 10:51am
#7
I made a npc move script and can i write it to local script that is inside the npc?
Yes, surely you can write it, if it’s not NPC spawner.
1 Like
Kanglim12
(Capybara)
March 6, 2023, 11:03am
#9
Then can i make a local model with local script?
Yes, surely, you can do it easily.
1 Like
Kanglim12
(Capybara)
March 6, 2023, 11:12am
#11
Thanks thats helped me a lot! now i can make it myself
1 Like
system
(system)
Closed
March 20, 2023, 11:12am
#12
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.