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

How to make "Vampires" burn in the sun?

Asked by 4 years ago

Hello I'm trying to make vampires burn and I litellary stuck in the point where I don't know what to do

local replicatedstorage = game:GetService("ReplicatedStorage")


local plr = game:GetService("Players").LocalPlayer
local replicatedstorage = game:GetService("ReplicatedStorage")
repeat
wait()
until plr.Character and plr.Character:FindFirstChild("Humanoid")
local PlayerCharacter = plr.Character
local Fire = replicatedstorage.Fire

local RunService = game:GetService("RunService")
local Lighting = game:GetService("Lighting")
local SunDir= Lighting:GetSunDirection ( )

So uh what do I do now?

0
You could try making a map wide local part that is cancollide=false that is only accessible by vampires, and have it disappear at night or only be available outside during daytime Lyphios 77 — 4y
0
That's a garbage idea. User#29813 0 — 4y
0
What about remaining vampires?ngl but it's too easy when I want to make sure that they,also I want to add some cape that will make vampires resistant to the Sun Banned_Monte 18 — 4y
0
Just check the clock time... if its a certain time then burn the vampire. greatneil80 2647 — 4y
0
ngl but another terrible idea since It will burn all vampires NOT the ones who are outside,under trees Banned_Monte 18 — 4y

3 answers

Log in to vote
1
Answered by
Syclya 224 Moderation Voter
4 years ago

You can detect this by using the ClockTime within the service Lighting. Simply check if it's day or night.

Ad
Log in to vote
0
Answered by 4 years ago

You could create a part above the player say 100, 500 studs above... Have the part move when the player moves using CFrame so it stays right above the player. When the player moves, send a RayCast from the part to the player. If it reaches the player, kill or take damage. However, if it touches something on the way down, then the player is in the shade(something is blocking the player from the sun).

Log in to vote
0
Answered by
Farsalis 369 Moderation Voter
4 years ago
Edited 4 years ago

Ah, Here's an Idea. Combining what syclya said.

Yes, use clock time, instead of Sun Direction. Have a part under each tree. When the player stands on the tree, throw a bool value into the player e.g.(Safe From Sun). When the player leaves, remove that value. If your accessing Clock Time through client, then add an argument like this:

if plr.Character:WaitForChild("SafeFromSun").Value == true then 

Or something like that.

0
You should never put a value in a character a exploiter can delete the value and break the game ;'/ your inspiring this dev to get their game hacked wth? fistter1 88 — 4y
0
Agreed, it can completely Destroy Client-Side. Especially if has only gone through LocalScript (Client), and not through the server. Something like this, would be better suited to ONLY be stored/saved by Server. Such as, Server Storage. Then, replicating it to the Client. Farsalis 369 — 4y

Answer this question